Class ZipArchiveInputStream.BoundCountInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Enclosing class:
    ZipArchiveInputStream

    private final class ZipArchiveInputStream.BoundCountInputStream
    extends org.apache.commons.io.input.BoundedInputStream
    Input stream adapted from commons-io.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.commons.io.input.BoundedInputStream

        org.apache.commons.io.input.BoundedInputStream.Builder
    • Field Summary

      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      BoundCountInputStream​(java.io.InputStream in, long max)
      Creates a new BoundedInputStream that wraps the given input stream and limits it to a certain size.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean atMaxLength()  
      int read()  
      int read​(byte[] b, int off, int len)  
      private int readCount​(int bytesRead)  
      • Methods inherited from class org.apache.commons.io.input.BoundedInputStream

        afterRead, available, builder, close, getCount, getMaxCount, getMaxLength, getRemaining, isPropagateClose, mark, markSupported, onMaxLength, read, reset, setPropagateClose, skip, toString
      • Methods inherited from class org.apache.commons.io.input.ProxyInputStream

        beforeRead, handleIOException, setReference, unwrap
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

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

      • BoundCountInputStream

        BoundCountInputStream​(java.io.InputStream in,
                              long max)
        Creates a new BoundedInputStream that wraps the given input stream and limits it to a certain size.
        Parameters:
        in - The wrapped input stream
        max - The maximum number of bytes to return
    • Method Detail

      • atMaxLength

        private boolean atMaxLength()
      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class org.apache.commons.io.input.BoundedInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class org.apache.commons.io.input.BoundedInputStream
        Throws:
        java.io.IOException
      • readCount

        private int readCount​(int bytesRead)