Code example for ByteBuffer

Methods: array, arrayOffset, hasArray, position

0
        in.get(bytes);
    } 
 
    protected Binary get(int size)
    { 
        if (in.hasArray())
        { 
            byte[] bytes = in.array();
            Binary bin = new Binary(bytes, in.arrayOffset() + in.position(), size);
            in.position(in.position() + size);
            return bin;
        } 
        else 
        { 
            return super.get(size);
        } 
    } 
 
    public boolean hasRemaining() 
    { 
        return in.hasRemaining();