/** * A utility function to return an InputStream to the ByteBuffer data * * @return An InputStream that starts at the beginning of the ByteBuffer data * and can read to the end of it. */ public InputStream sizedInputStream() { finished(); ByteBuffer duplicate = bb.duplicate(); duplicate.position(space); duplicate.limit(bb.capacity()); return new ByteBufferBackedInputStream(duplicate); }
/** * A utility function to return an InputStream to the ByteBuffer data * * @return An InputStream that starts at the beginning of the ByteBuffer data * and can read to the end of it. */ public InputStream sizedInputStream() { finished(); ByteBuffer duplicate = bb.duplicate(); duplicate.position(space); duplicate.limit(bb.capacity()); return new ByteBufferBackedInputStream(duplicate); }
/** * A utility function to return an InputStream to the ByteBuffer data * * @return An InputStream that starts at the beginning of the ByteBuffer data * and can read to the end of it. */ public InputStream sizedInputStream() { finished(); ByteBuffer duplicate = bb.duplicate(); duplicate.position(space); duplicate.limit(bb.capacity()); return new ByteBufferBackedInputStream(duplicate); }