@Override
  public void writeTo(AsyncWritableChannel channel, Callback<Long> callback) {
    if (bufferToSend == null) {
      prepareBuffer();
    }
    channel.write(bufferToSend, callback);
    if (toSend != null) {
      toSend.writeTo(channel, callback);
    }
  }
A private method shared by {@link GetResponse#writeTo(WritableByteChannel)} and
{@link GetResponse#writeTo(AsyncWritableChannel, Callback)}.
This method allocate bufferToSend and write metadata to it if bufferToSend is null.
ambry-protocol/src/main/java/com/github/ambry/protocol/GetResponse.java