protected void prepareBuffer() {
    if (bufferToSend == null) {
      bufferToSend = PooledByteBufAllocator.DEFAULT.ioBuffer((int) sizeInBytes());
      writeHeader();
    }
  }
Request Response for serialization and de-serialization
ambry-protocol/src/main/java/com/github/ambry/protocol/RequestOrResponse.java