@Override
  public void writeAsSerializedByteArray(Object v) throws IOException {
    ByteBuffer sizeBuf = buffer;
    int sizePos = sizeBuf.position();
    sizeBuf.position(sizePos + 5);
    final int preArraySize = size();
    DataSerializer.writeObject(v, this);
    int arraySize = size() - preArraySize;
    sizeBuf.put(sizePos, StaticSerialization.INT_ARRAY_LEN);
    sizeBuf.putInt(sizePos + 1, arraySize);
  }
Writes the given object to this stream as a byte array. The byte array is produced by
serializing v. The serialization is done by calling DataSerializer.writeObject.
geode-core/src/main/java/org/apache/geode/internal/tcp/MsgOutputStream.java