bson/src/main/org/bson/RawBsonDocument.java
public ByteBuf getByteBuffer() {
        ByteBuffer buffer = ByteBuffer.wrap(bytes, offset, length);
        buffer.order(ByteOrder.LITTLE_ENDIAN);
        return new ByteBufNIO(buffer);
    }
public ByteBuf getByteBuffer() {
        ByteBuffer buffer = ByteBuffer.wrap(bytes, offset, length);
        buffer.order(ByteOrder.LITTLE_ENDIAN);
        return new ByteBufNIO(buffer);
    }
Returns a {@code ByteBuf} that wraps the byte array, with the proper byte order.  Any changes made to the returned will be reflected
in the underlying byte array owned by this instance.

@return a byte buffer that wraps the byte array owned by this instance.