class HeapDataOutputStream extends
    org.apache.geode.internal.serialization.BufferDataOutputStream implements ObjToByteArraySerializer, ByteBufferWriter {

  public void write(ByteBufferInputStream.ByteSource source) {
    ByteBuffer bb = source.getBackingByteBuffer();
    if (bb != null) {
      write(bb);
      return;
    }
    if (this.ignoreWrites)
      return;
    checkIfWritable();
    int remainingSpace = this.buffer.limit() - this.buffer.position();
    if (remainingSpace < source.remaining()) {
      int oldLimit = source.limit();
      source.limit(source.position() + remainingSpace);
      source.sendTo(this.buffer);
      source.limit(oldLimit);
      ensureCapacity(source.remaining());
    }
    source.sendTo(this.buffer);
  }

  public  HeapDataOutputStream(KnownVersion version);
  public  HeapDataOutputStream(String s);
  public  HeapDataOutputStream(int allocSize, KnownVersion version);
  public  HeapDataOutputStream(int allocSize);
  public  HeapDataOutputStream(int allocSize, KnownVersion version, boolean doNotCopy);
  public  HeapDataOutputStream(ByteBuffer initialBuffer, KnownVersion version, boolean doNotCopy);
  public  HeapDataOutputStream(byte[] bytes);

}