List of utility methods to do ByteBuffer to Stream
InputStream | toStream(ByteBuffer byteBuffer) to Stream byte[] bytes = new byte[byteBuffer.remaining()]; byteBuffer.get(bytes); return new ByteArrayInputStream(bytes); |
ByteArrayInputStream | toStream(ByteBuffer byteBuffer) Wraps a ByteBuffer in an InputStream. if (byteBuffer == null) { return new ByteArrayInputStream(new byte[0]); return new ByteArrayInputStream(copyBytesFrom(byteBuffer)); |