public static ByteBuffer readBytes(ByteBuffer bb, int length)
    {
        ByteBuffer copy = bb.duplicate();
        copy.limit(copy.position() + length);
        bb.position(bb.position() + length);
        return copy;
    }
public static ByteBuffer readBytes ( ByteBuffer bb , int length ) { ByteBuffer copy = bb . duplicate ( ) ; copy . limit ( copy . position ( ) + length ) ; bb . position ( bb . position ( ) + length ) ; return copy ; }
changes bb position