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.ByteInputByteInputimplementation which wraps anotherByteInputand throws aLimitingByteInput.TooBigObjectExceptionif the read limit was reached.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classLimitingByteInput.TooBigObjectExceptionException that will get thrown if theObjectis to big to unmarshall
-
Field Summary
Fields Modifier and Type Field Description private static LimitingByteInput.TooBigObjectExceptionEXCEPTIONprivate org.jboss.marshalling.ByteInputinputprivate longlimitprivate longread
-
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 intavailable()voidclose()intread()intread(byte[] array)intread(byte[] array, int offset, int length)private intreadable(int length)longskip(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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Specified by:
availablein interfaceorg.jboss.marshalling.ByteInput- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin interfaceorg.jboss.marshalling.ByteInput- Throws:
java.io.IOException
-
read
public int read(byte[] array) throws java.io.IOException- Specified by:
readin interfaceorg.jboss.marshalling.ByteInput- Throws:
java.io.IOException
-
read
public int read(byte[] array, int offset, int length) throws java.io.IOException- Specified by:
readin interfaceorg.jboss.marshalling.ByteInput- Throws:
java.io.IOException
-
skip
public long skip(long bytes) throws java.io.IOException- Specified by:
skipin interfaceorg.jboss.marshalling.ByteInput- Throws:
java.io.IOException
-
readable
private int readable(int length)
-
-