internal ByteBuffer Encode(IBufferManager bufferManager, int reservedBytes) { // get some extra space to store the frame header // and the transfer command. int size = reservedBytes + this.GetEstimatedMessageSize(); ByteBuffer buffer = bufferManager.GetByteBuffer(size); buffer.AdjustPosition(buffer.Offset + reservedBytes, 0); this.WriteToBuffer(buffer); return(buffer); }
internal ByteBuffer Encode(IBufferManager bufferManager, int reservedBytes) { // get some extra space to store the frame header // and the transfer command. int size = reservedBytes + this.GetEstimatedMessageSize(); ByteBuffer buffer = bufferManager.GetByteBuffer(size); buffer.AdjustPosition(buffer.Offset + reservedBytes, 0); this.WriteToBuffer(buffer); return buffer; }