Code example for ByteBuffer

Methods: positionremainingarrayarrayOffsethasArray

0
        return tmp;
    } 
 
    @Override 
    public BytesArray toBytesArray() { 
        if (buffer.hasArray()) {
            return new BytesArray(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining());
        } 
        return new BytesArray(toBytes()); 
    } 
 
    @Override 
    public BytesArray copyBytesArray() { 
        return new BytesArray(toBytes()); 
    } 
 
    @Override 
    public ChannelBuffer toChannelBuffer() { 
        return ChannelBuffers.wrappedBuffer(buffer);
    }