public void read(int length, ByteBuffer buffer) throws IllegalStateException, IOException {
        buffer.put(read(length));
    }
public void read ( int length , ByteBuffer buffer ) throws IllegalStateException , IOException { buffer . put ( read ( length ) ) ; }
<p>Reads a length bytes from the serial port/device into a provided ByteBuffer.</p>

@param length
The number of bytes to get from the serial port/device.
This number must not be higher than the number of available bytes.
@param buffer
The ByteBuffer object to write to.