Java Utililty Methods ByteBuffer to Stream

List of utility methods to do ByteBuffer to Stream

Description

The list of methods to do ByteBuffer to Stream are organized into topic(s).

Method

InputStreamtoStream(ByteBuffer byteBuffer)
to Stream
byte[] bytes = new byte[byteBuffer.remaining()];
byteBuffer.get(bytes);
return new ByteArrayInputStream(bytes);
ByteArrayInputStreamtoStream(ByteBuffer byteBuffer)
Wraps a ByteBuffer in an InputStream.
if (byteBuffer == null) {
    return new ByteArrayInputStream(new byte[0]);
return new ByteArrayInputStream(copyBytesFrom(byteBuffer));