GeezerVison is showing netty.io — ByteBufOutputStream (Netty API Reference (4.1.141.Final))
Class ByteBufOutputStream
- All Implemented Interfaces:
Closeable, DataOutput, Flushable, AutoCloseable
An
OutputStream which writes data to a
ByteBuf.
A write operation against this stream will occur at the writerIndex
of its underlying buffer and the writerIndex will increase during
the write operation.
This stream implements DataOutput for your convenience.
The endianness of the stream is not always big endian but depends on
the endianness of the underlying buffer.
- See Also:
-
-
Constructor Summary
Constructors
Constructor
Description
Creates a new stream which writes data to the specified buffer.
Creates a new stream which writes data to the specified buffer.
-
Method Summary
Modifier and Type
Method
Description
Returns the buffer where this stream is writing data.
void
void
void
write(byte[] b,
int off,
int len)
void
void
void
void
void
void
void
void
void
void
void
void
int
Returns the number of written bytes by this stream so far.
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ByteBufOutputStream
public ByteBufOutputStream(ByteBuf buffer)
Creates a new stream which writes data to the specified buffer.
-
ByteBufOutputStream
public ByteBufOutputStream(ByteBuf buffer,
boolean releaseOnClose)
Creates a new stream which writes data to the specified buffer.
- Parameters:
buffer - Writes data to the buffer for this OutputStream.
releaseOnClose - true means that when close() is called then ReferenceCounted.release() will
be called on buffer.
-
Method Details
-
writtenBytes
public int writtenBytes()
Returns the number of written bytes by this stream so far.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
buffer
Returns the buffer where this stream is writing data.
-