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, reset
public 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.ByteInput
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in interface org.jboss.marshalling.ByteInput
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in interface org.jboss.marshalling.ByteInput
read
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in interface org.jboss.marshalling.ByteInput
skip
in class InputStream
IOException
public int available() throws IOException
available
in interface org.jboss.marshalling.ByteInput
available
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
Copyright © 2023 JBoss by Red Hat. All rights reserved.