Class LimitingByteInput

java.lang.Object
org.jboss.netty.handler.codec.marshalling.LimitingByteInput
All Implemented Interfaces:
Closeable, AutoCloseable, org.jboss.marshalling.ByteInput

class LimitingByteInput extends Object implements org.jboss.marshalling.ByteInput
ByteInput implementation which wraps another ByteInput and throws a LimitingByteInput.TooBigObjectException if the read limit was reached.
  • Field Details

    • EXCEPTION

      private static final LimitingByteInput.TooBigObjectException EXCEPTION
    • input

      private final org.jboss.marshalling.ByteInput input
    • limit

      private final long limit
    • read

      private long read
  • Constructor Details

    • LimitingByteInput

      public LimitingByteInput(org.jboss.marshalling.ByteInput input, long limit)
  • Method Details

    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • available

      public int available() throws IOException
      Specified by:
      available in interface org.jboss.marshalling.ByteInput
      Throws:
      IOException
    • read

      public int read() throws IOException
      Specified by:
      read in interface org.jboss.marshalling.ByteInput
      Throws:
      IOException
    • read

      public int read(byte[] array) throws IOException
      Specified by:
      read in interface org.jboss.marshalling.ByteInput
      Throws:
      IOException
    • read

      public int read(byte[] array, int offset, int length) throws IOException
      Specified by:
      read in interface org.jboss.marshalling.ByteInput
      Throws:
      IOException
    • skip

      public long skip(long bytes) throws IOException
      Specified by:
      skip in interface org.jboss.marshalling.ByteInput
      Throws:
      IOException
    • readable

      private int readable(int length)