Top Description Fields Constructors Methods
org.jboss.marshalling

public Class LimitedByteOutput

extends ByteOutputStream
Class Inheritance
Imports
java.io.IOException, .InterruptedIOException

A limited byte output stream. Throws an exception if too many bytes are written.

Field Summary

Modifier and TypeField and Description
private long
private final long
Inherited from org.jboss.marshalling.ByteOutputStream:
byteOutput

Constructor Summary

AccessConstructor and Description
public
LimitedByteOutput(final ByteOutput
the byte output to write to
byteOutput
,
final long
the byte limit
limit
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public void
write(final int
the byte to write
b
)

Overrides org.jboss.marshalling.ByteOutputStream.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
,
final int
the index to start writing from
off
,
final int
the number of bytes to write
len
)

Overrides org.jboss.marshalling.ByteOutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write.

Write some of the bytes from the given array to the stream.
Inherited from org.jboss.marshalling.ByteOutputStream:
closeflushwrite

Field Detail

countback to summary
private long count
limitback to summary
private final long limit

Constructor Detail

LimitedByteOutputback to summary
public LimitedByteOutput(final ByteOutput byteOutput, final long limit)

Construct a new instance.

Parameters
byteOutput:ByteOutput

the byte output to write to

limit:long

the byte limit

Method Detail

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

Overrides org.jboss.marshalling.ByteOutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write.

Doc from org.jboss.marshalling.ByteOutputStream.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

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

the byte to write

Exceptions
IOException:

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

if an error occurs

writeback to summary
public void write(final byte[] b, final int off, final int len) throws IOException

Overrides org.jboss.marshalling.ByteOutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write.

Doc from org.jboss.marshalling.ByteOutputStream.write.

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

Parameters
b:byte[]

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

the byte array

off:int

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

the index to start writing from

len:int

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

the number of bytes to write

Exceptions
IOException:

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

if an error occurs