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, write
public BytesOutputStream(Bytes bytes)
BytesOutputStream
backed by the given bytes
.bytes
- the Bytes
backing the constructed BytesOutputStream
public 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 BytesOutputStream
BytesOutputStream
object backpublic void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
public void write(@NotNull byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
Copyright © 2019. All rights reserved.