@Test public void testEmpty() throws IOException { ByteBuffer bb = ByteBuffer.allocate(0); InputStream is = new ByteBufferInputStream(bb); assertEquals(-1, is.read()); is.close(); }
@Override public int read() { if (buffer.hasRemaining()) { return buffer.get() & 0xff; } return -1; }
ByteBufferInputStream extends InputStream { @Override public int read() { if (buffer.hasRemaining()) { return buffer.get() & 0xff; } return -1; } }
ByteBufferInputStream extends InputStream { @Override public int read() { if (buffer.hasRemaining()) { return buffer.get() & 0xff; } return -1; } ByteBufferInputStream(ByteBuffer buffer); }
ByteBufferInputStream extends InputStream { @Override public int read() { if (buffer.hasRemaining()) { return buffer.get() & 0xff; } return -1; } ByteBufferInputStream(ByteBuffer buffer); @Override int available(); @Override synchronized void mark(int readlimit); @Override boolean markSupported(); @Override int read(); @Override int read(byte[] b, int off, int len); @Override synchronized void reset(); @Override long skip(long n); }
ByteBufferInputStream extends InputStream { @Override public int read() { if (buffer.hasRemaining()) { return buffer.get() & 0xff; } return -1; } ByteBufferInputStream(ByteBuffer buffer); @Override int available(); @Override synchronized void mark(int readlimit); @Override boolean markSupported(); @Override int read(); @Override int read(byte[] b, int off, int len); @Override synchronized void reset(); @Override long skip(long n);  }