public class ChunkyByteInput extends InputStream implements org.jboss.marshalling.ByteInput
CHUNK_START header followed
by the length of the chunk. At the end of all the chunks it will run into a END byte, which will appear as the end
of the stream. This is used when you need to ensure a consumer of the input can not read more than necessary. This is handy
if the consumer of the stream is prone to over-buffering. Note this will only work for byte streams that were written using a
ChunkyByteOutput.| Modifier and Type | Field and Description |
|---|---|
static int |
CHUNK_START |
static int |
END |
| Constructor and Description |
|---|
ChunkyByteInput(org.jboss.marshalling.ByteInput byteInput) |
ChunkyByteInput(InputStream inputStream) |
ChunkyByteInput(InputStream inputStream,
int remaining) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long n) |
mark, markSupported, resetpublic static final int CHUNK_START
public static final int END
public ChunkyByteInput(org.jboss.marshalling.ByteInput byteInput)
public ChunkyByteInput(InputStream inputStream)
public ChunkyByteInput(InputStream inputStream, int remaining)
public int read()
throws IOException
read in interface org.jboss.marshalling.ByteInputread in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in interface org.jboss.marshalling.ByteInputread in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in interface org.jboss.marshalling.ByteInputread in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in interface org.jboss.marshalling.ByteInputskip in class InputStreamIOExceptionpublic int available()
throws IOException
available in interface org.jboss.marshalling.ByteInputavailable in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionCopyright © 2019 JBoss by Red Hat. All rights reserved.