Top Description Fields Constructors Methods
io.netty.handler.codec.marshalling

pack-priv Class ChannelBufferByteOutput

extends Object
implements ByteOutput
Class Inheritance
All Implemented Interfaces
org.jboss.marshalling.ByteOutput, java.io.Flushable, java.io.Closeable, java.lang.AutoCloseable
Imports
io.netty.buffer.ByteBuf, org.jboss.marshalling.ByteOutput, java.io.IOException

ByteOutput implementation which writes the data to a ByteBuf

Field Summary

Modifier and TypeField and Description
private final ByteBuf

Constructor Summary

AccessConstructor and Description
pack-priv
ChannelBufferByteOutput(ByteBuf buffer)

Create a new instance which use the given ByteBuf

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public void
flush()

Implements java.io.Flushable.flush.

Flushes this stream by writing any buffered output to the underlying stream.
pack-priv ByteBuf
getBuffer()

Return the ByteBuf which contains the written content

public void
write(int
the byte to write
b
)

Implements org.jboss.marshalling.ByteOutput.write.

Writes to the output stream the eight low-order bits of the argument b.
public void
write(byte[]
the byte array
bytes
)

Implements org.jboss.marshalling.ByteOutput.write.

Write all the bytes from the given array to the stream.
public void
write(byte[]
the byte array
bytes
,
int
the index to start writing from
srcIndex
,
int
the number of bytes to write
length
)

Implements org.jboss.marshalling.ByteOutput.write.

Write some of the bytes from the given array to the stream.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
private final ByteBuf buffer

Constructor Detail

ChannelBufferByteOutputback to summary
pack-priv ChannelBufferByteOutput(ByteBuf buffer)

Create a new instance which use the given ByteBuf

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
flushback to summary
public void flush() throws IOException

Implements java.io.Flushable.flush.

Doc from java.io.Flushable.flush.

Flushes this stream by writing any buffered output to the underlying stream.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
getBufferback to summary
pack-priv ByteBuf getBuffer()

Return the ByteBuf which contains the written content

writeback to summary
public void write(int b) throws IOException

Implements org.jboss.marshalling.ByteOutput.write.

Doc from org.jboss.marshalling.ByteOutput.write.

Writes to the output stream the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters
b:int

the byte to write

Annotations
@Override
Exceptions
IOException:
if an error occurs
writeback to summary
public void write(byte[] bytes) throws IOException

Implements org.jboss.marshalling.ByteOutput.write.

Doc from org.jboss.marshalling.ByteOutput.write.

Write all the bytes from the given array to the stream.

Parameters
bytes:byte[]

the byte array

Annotations
@Override
Exceptions
IOException:
if an error occurs
writeback to summary
public void write(byte[] bytes, int srcIndex, int length) throws IOException

Implements org.jboss.marshalling.ByteOutput.write.

Doc from org.jboss.marshalling.ByteOutput.write.

Write some of the bytes from the given array to the stream.

Parameters
bytes:byte[]

the byte array

srcIndex:int

the index to start writing from

length:int

the number of bytes to write

Annotations
@Override
Exceptions
IOException:
if an error occurs