public void sendTo(ByteBufferWriter out) {
    finishWriting();
    if (chunks != null) {
      for (ByteBuffer bb : chunks) {
        basicSendTo(out, bb);
      }
    }
    basicSendTo(out, buffer);
  }
Write the contents of this stream to the specified stream.
geode-core/src/main/java/org/apache/geode/internal/HeapDataOutputStream.java