Class 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 another ByteInput and throws a LimitingByteInput.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 the Object is to big to unmarshall
    • 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LimitingByteInput

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

      • close

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

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

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

        public int read​(byte[] array)
                 throws java.io.IOException
        Specified by:
        read in interface org.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 interface org.jboss.marshalling.ByteInput
        Throws:
        java.io.IOException
      • skip

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

        private int readable​(int length)