@Test(expected=BufferSizeException.class)
public void getToCauseBufferSizeException() throws BufferException {

    ByteBuffer buffer = new ByteBuffer(5);
    // buffer is only size 0 now
    // this should fail
    byte b = buffer.get(0);
}