Class LimitingByteInput
- java.lang.Object
-
- org.jboss.netty.handler.codec.marshalling.LimitingByteInput
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,org.jboss.marshalling.ByteInput
class LimitingByteInput extends java.lang.Object implements org.jboss.marshalling.ByteInput
ByteInput
implementation which wraps anotherByteInput
and throws aLimitingByteInput.TooBigObjectException
if the read limit was reached.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
LimitingByteInput.TooBigObjectException
Exception that will get thrown if theObject
is to big to unmarshall
-
Field Summary
Fields Modifier and Type Field Description private static LimitingByteInput.TooBigObjectException
EXCEPTION
private org.jboss.marshalling.ByteInput
input
private long
limit
private long
read
-
Constructor Summary
Constructors Constructor Description LimitingByteInput(org.jboss.marshalling.ByteInput input, long limit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Field Detail
-
EXCEPTION
private static final LimitingByteInput.TooBigObjectException EXCEPTION
-
input
private final org.jboss.marshalling.ByteInput input
-
limit
private final long limit
-
read
private long read
-
-
Method Detail
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException
- Specified by:
available
in interfaceorg.jboss.marshalling.ByteInput
- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException
- Specified by:
read
in interfaceorg.jboss.marshalling.ByteInput
- Throws:
java.io.IOException
-
read
public int read(byte[] array) throws java.io.IOException
- Specified by:
read
in interfaceorg.jboss.marshalling.ByteInput
- Throws:
java.io.IOException
-
read
public int read(byte[] array, int offset, int length) throws java.io.IOException
- Specified by:
read
in interfaceorg.jboss.marshalling.ByteInput
- Throws:
java.io.IOException
-
skip
public long skip(long bytes) throws java.io.IOException
- Specified by:
skip
in interfaceorg.jboss.marshalling.ByteInput
- Throws:
java.io.IOException
-
readable
private int readable(int length)
-
-