Class ZipFile.BoundedInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    ZipFile.BoundedFileChannelInputStream
    Enclosing class:
    ZipFile

    private class ZipFile.BoundedInputStream
    extends java.io.InputStream
    InputStream that delegates requests to the underlying SeekableByteChannel, making sure that only bytes from a certain range can be read.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long end  
      private long loc  
      private java.nio.ByteBuffer singleByteBuffer  
    • Constructor Summary

      Constructors 
      Constructor Description
      BoundedInputStream​(long start, long remaining)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int read()  
      int read​(byte[] b, int off, int len)  
      protected int read​(long pos, java.nio.ByteBuffer buf)  
      • 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
    • Field Detail

      • singleByteBuffer

        private java.nio.ByteBuffer singleByteBuffer
      • end

        private final long end
      • loc

        private long loc
    • Constructor Detail

      • BoundedInputStream

        BoundedInputStream​(long start,
                           long remaining)
    • 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 int read​(long pos,
                           java.nio.ByteBuffer buf)
                    throws java.io.IOException
        Throws:
        java.io.IOException