* Reads up to buf.remaining() bytes into buf. Callers should use
* buf.limit(..) to control the size of the desired read.
* After the call, buf.position() should be unchanged, and therefore any data
* can be immediately read from buf.
* @param buf
* @return - the number of bytes available to read from buf
* @throws IOException
public int read(ByteBuffer buf) throws IOException;