Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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;
 }