public int readFrom(byte[] src, int srcOffset, long destOffset, int length) {
        int readLen = (int) Math.min(src.length - srcOffset, Math.min(size() - destOffset, length));
        ByteBuffer b = toDirectByteBuffer(destOffset, readLen);
        b.position(0);
        b.put(src, srcOffset, readLen);
        return readLen;
    }
public int readFrom ( byte [ ] src , int srcOffset , long destOffset , int length ) { int readLen = ( int ) Math . min ( src . length - srcOffset , Math . min ( size ( ) - destOffset , length ) ) ; ByteBuffer b = toDirectByteBuffer ( destOffset , readLen ) ; b . position ( 0 ) ; b . put ( src , srcOffset , readLen ) ; return readLen ; }
Read the given source byte array, then overwrite this buffer's contents

@param src source byte array
@param srcOffset offset in source byte array to read from
@param destOffset offset in this buffer to read to
@param length max number of bytes to read
@return the number of bytes read