Top Description Fields Constructors Methods
org.jboss.marshalling

public Class ByteOutputStream

extends SimpleByteOutput
Class Inheritance
Known Direct Subclasses
org.jboss.marshalling.LimitedByteOutput, org.jboss.marshalling.SimpleDataOutput
Imports
java.io.IOException, .OutputStream

An OutputStream which implements ByteOutput and writes bytes to another ByteOutput. Usually the Marshalling#createByteOutput(OutputStream) method should be used to create instances because it can detect when the target already implements ByteOutput.

Field Summary

Modifier and TypeField and Description
protected volatile ByteOutput

Constructor Summary

AccessConstructor and Description
public
ByteOutputStream(final ByteOutput
the byte output to write to
byteOutput
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

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

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Flushes this stream by writing any buffered output to the underlying stream.
public void
write(final int
the byte to write
b
)

Implements abstract java.io.OutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write.

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

Overrides java.io.OutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write.

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

Overrides java.io.OutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write.

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

Field Detail

byteOutputback to summary
protected volatile ByteOutput byteOutput

Constructor Detail

ByteOutputStreamback to summary
public ByteOutputStream(final ByteOutput byteOutput)

Construct a new instance.

Parameters
byteOutput:ByteOutput

the byte output to write to

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.OutputStream.close.

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.

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

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Doc from java.io.Flushable.flush.

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

Exceptions
IOException:
If an I/O error occurs
writeback to summary
public void write(final int b) throws IOException

Implements abstract java.io.OutputStream.write.

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

Exceptions
IOException:
if an error occurs
writeback to summary
public void write(final byte[] b) throws IOException

Overrides java.io.OutputStream.write.

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
b:byte[]

the byte array

Exceptions
IOException:
if an error occurs
writeback to summary
public void write(final byte[] b, final int off, final int len) throws IOException

Overrides java.io.OutputStream.write.

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
b:byte[]

the byte array

off:int

the index to start writing from

len:int

the number of bytes to write

Exceptions
IOException:
if an error occurs