@Test public void testNegativeSingleByteRead() { byte[] expected = new byte[1]; expected[0] = -100; try (GatheringByteArrayInputStream in = new GatheringByteArrayInputStream(ImmutableList.of(expected), expected.length)) { assertEquals(in.read(), expected[0] & 0x000000ff); assertEquals(in.read(), -1); } }
@Override public synchronized int read(byte[] buffer) { return read(buffer, 0, buffer.length); }
GatheringByteArrayInputStream extends InputStream { @Override public synchronized int read(byte[] buffer) { return read(buffer, 0, buffer.length); } }
GatheringByteArrayInputStream extends InputStream { @Override public synchronized int read(byte[] buffer) { return read(buffer, 0, buffer.length); } GatheringByteArrayInputStream(List<byte[]> buffers, long totalBytes); }
GatheringByteArrayInputStream extends InputStream { @Override public synchronized int read(byte[] buffer) { return read(buffer, 0, buffer.length); } GatheringByteArrayInputStream(List<byte[]> buffers, long totalBytes); @Override synchronized int read(byte[] buffer); @Override synchronized int read(); @Override synchronized long skip(long n); @Override synchronized int read(byte[] buffer, int offset, int length); @Override void close(); }
GatheringByteArrayInputStream extends InputStream { @Override public synchronized int read(byte[] buffer) { return read(buffer, 0, buffer.length); } GatheringByteArrayInputStream(List<byte[]> buffers, long totalBytes); @Override synchronized int read(byte[] buffer); @Override synchronized int read(); @Override synchronized long skip(long n); @Override synchronized int read(byte[] buffer, int offset, int length); @Override void close();  }