Class BoundedArchiveInputStream

    • Constructor Summary

      Constructors 
      Constructor Description
      BoundedArchiveInputStream​(long start, long remaining)
      Constructs a new bounded input stream.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int read()  
      int read​(byte[] b, int off, int len)  
      protected abstract int read​(long pos, java.nio.ByteBuffer buf)
      Reads content of the stream into a ByteBuffer.
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • BoundedArchiveInputStream

        public BoundedArchiveInputStream​(long start,
                                         long remaining)
        Constructs a new bounded input stream.
        Parameters:
        start - position in the stream from where the reading of this bounded stream starts.
        remaining - amount of bytes which are allowed to read from the bounded stream.
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        protected abstract int read​(long pos,
                                    java.nio.ByteBuffer buf)
                             throws java.io.IOException
        Reads content of the stream into a ByteBuffer.
        Parameters:
        pos - position to start the read.
        buf - buffer to add the read content.
        Returns:
        number of read bytes.
        Throws:
        java.io.IOException - if I/O fails.