@Test public void testReadArrayOffsetLength_HitEndOfStream() throws Exception { for (int i = 0; i < DATA_BYTES.length - 1; i++) { in.read(); } assertEquals(1, in.read(bs, 2, 2)); byte[] expected = new byte[] { (byte) 1, (byte) 2, DATA_BYTES[DATA_BYTES.length - 1], (byte) 4 }; assertArrayEquals(expected, bs); }
@Override public int read() throws IOException { if (bb.remaining() == 0) { return -1; } return bb.get() & 0xff; }
ByteBufferInputStream extends InputStream { @Override public int read() throws IOException { if (bb.remaining() == 0) { return -1; } return bb.get() & 0xff; } }
ByteBufferInputStream extends InputStream { @Override public int read() throws IOException { if (bb.remaining() == 0) { return -1; } return bb.get() & 0xff; } ByteBufferInputStream(ByteBuffer bb); }
ByteBufferInputStream extends InputStream { @Override public int read() throws IOException { if (bb.remaining() == 0) { return -1; } return bb.get() & 0xff; } ByteBufferInputStream(ByteBuffer bb); @Override int read(); @Override int available(); @Override int read(byte[] b, int off, int len); @Override int read(byte[] b); @Override long skip(long n); static void byteBuffer2Record(ByteBuffer bb, Record record); }
ByteBufferInputStream extends InputStream { @Override public int read() throws IOException { if (bb.remaining() == 0) { return -1; } return bb.get() & 0xff; } ByteBufferInputStream(ByteBuffer bb); @Override int read(); @Override int available(); @Override int read(byte[] b, int off, int len); @Override int read(byte[] b); @Override long skip(long n); static void byteBuffer2Record(ByteBuffer bb, Record record);  }