public class ChunkyByteOutput extends OutputStream implements org.jboss.marshalling.ByteOutput
CHUNK_START header followed by the size of the chunk being flushed. Once the closed, this will write out a
END byte. This should be used to write data that can be read by a ChunkyByteInput
to ensure the reader can not read more than available. This is handy if the consumer of the stream is prone to over-buffering.| Modifier and Type | Field and Description |
|---|---|
static int |
CHUNK_START |
static int |
END |
| Constructor and Description |
|---|
ChunkyByteOutput(org.jboss.marshalling.ByteOutput output) |
ChunkyByteOutput(org.jboss.marshalling.ByteOutput output,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Flushes the current buffer then write a
END byte. |
void |
flush()
Writes a
CHUNK_START header followed by the size of chunk being flushed followed by the data being flushed. |
void |
write(byte[] bytes) |
void |
write(byte[] bytes,
int off,
int len) |
void |
write(int v) |
void |
writeInt(int i) |
public static final int CHUNK_START
public static final int END
public ChunkyByteOutput(org.jboss.marshalling.ByteOutput output)
public ChunkyByteOutput(org.jboss.marshalling.ByteOutput output,
int bufferSize)
public void write(int v)
throws IOException
write in interface org.jboss.marshalling.ByteOutputwrite in class OutputStreamIOExceptionpublic void write(byte[] bytes)
throws IOException
write in interface org.jboss.marshalling.ByteOutputwrite in class OutputStreamIOExceptionpublic void write(byte[] bytes,
int off,
int len)
throws IOException
write in interface org.jboss.marshalling.ByteOutputwrite in class OutputStreamIOExceptionpublic void close()
throws IOException
END byte. This will not close the underlying byte outputclose in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void flush()
throws IOException
CHUNK_START header followed by the size of chunk being flushed followed by the data being flushed.
It will then flush the underlying byte output.flush in interface Flushableflush in class OutputStreamIOExceptionpublic void writeInt(int i)
throws IOException
IOExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.