public class BytesOutputStream extends OutputStream
OutputStream view of Bytes. Writing data to this stream pushes position of the underlying Bytes. On attempt of writing bytes beyond
backing Bytes' limit IOException is thrown.
BytesOutputStream are reusable, see bytes(Bytes) method.
BytesCommon.outputStream(),
BytesInputStream| Constructor and Description |
|---|
BytesOutputStream()
Constructs a
BytesOutputStream without backing Bytes, bytes(Bytes)
method must be called before first actual use of the constructed BytesOutputStream
instance. |
BytesOutputStream(Bytes bytes)
Constructs a
BytesOutputStream backed by the given bytes. |
| Modifier and Type | Method and Description |
|---|---|
BytesOutputStream |
bytes(Bytes bytes)
Reassigns the underlying
Bytes of this output stream. |
void |
close() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
flush, writepublic BytesOutputStream(Bytes bytes)
BytesOutputStream backed by the given bytes.bytes - the Bytes backing the constructed BytesOutputStreampublic BytesOutputStream()
BytesOutputStream without backing Bytes, bytes(Bytes)
method must be called before first actual use of the constructed BytesOutputStream
instance.public BytesOutputStream bytes(Bytes bytes)
Bytes of this output stream.bytes - new Bytes backing this BytesOutputStreamBytesOutputStream object backpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreampublic void write(@NotNull
byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionCopyright © 2019. All rights reserved.