public interface ByteBufferStreams
ByteBuffer objects
as InputStream/OutputStream objects. The class extends
the input and output stream classes, as well as DataInput/DataOutput.
For the input class, you can change the underlying buffer when needed, and access the current working buffer.
For the output class, if the underlying ByteBuffer runs out of room, a callback is made to allow the user to provide a new buffer with enough room.
These classes also include primitives for directly writing/reading ByteBuffers into the stream.
These classes are NOT in anyway thread safe, not a single synchronized access anywhere; since the underlying ByteBuffer is not thread safe, seemed pointless. If you need concurrency, wrap these classes.
| Modifier and Type | Interface and Description |
|---|---|
static class |
ByteBufferStreams.Input
InputStream/DataInput over ByteBuffer.
|
static class |
ByteBufferStreams.Output
Output stream class over ByteBuffer.
|
Copyright © 2020. All rights reserved.