class LimitingByteInput
extends java.lang.Object
implements org.jboss.marshalling.ByteInput
ByteInput implementation which wraps another ByteInput and throws a LimitingByteInput.TooBigObjectException
if the read limit was reached.| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
LimitingByteInput.TooBigObjectException
Exception that will get thrown if the
Object is to big to unmarshall |
| Modifier and Type | Field and Description |
|---|---|
private static LimitingByteInput.TooBigObjectException |
EXCEPTION |
private org.jboss.marshalling.ByteInput |
input |
private long |
limit |
private long |
read |
| Constructor and Description |
|---|
LimitingByteInput(org.jboss.marshalling.ByteInput input,
long limit) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
int |
read() |
int |
read(byte[] array) |
int |
read(byte[] array,
int offset,
int length) |
private int |
readable(int length) |
long |
skip(long bytes) |
private static final LimitingByteInput.TooBigObjectException EXCEPTION
private final org.jboss.marshalling.ByteInput input
private final long limit
private long read
LimitingByteInput(org.jboss.marshalling.ByteInput input,
long limit)
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic int available()
throws java.io.IOException
available in interface org.jboss.marshalling.ByteInputjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in interface org.jboss.marshalling.ByteInputjava.io.IOExceptionpublic int read(byte[] array)
throws java.io.IOException
read in interface org.jboss.marshalling.ByteInputjava.io.IOExceptionpublic int read(byte[] array,
int offset,
int length)
throws java.io.IOException
read in interface org.jboss.marshalling.ByteInputjava.io.IOExceptionpublic long skip(long bytes)
throws java.io.IOException
skip in interface org.jboss.marshalling.ByteInputjava.io.IOExceptionprivate int readable(int length)