Documentation of 'org.apache.commons.compress.utils.BoundedInputStream' Java class
BoundedInputStream
org.apache.commons.compress.utils

Class BoundedInputStream

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


    public class BoundedInputStream
    extends java.io.InputStream
    A stream that limits reading from a wrapped stream to a given number of bytes.
    Since:
    1.6
    • Constructor Summary

      Constructors 
      Constructor and Description
      BoundedInputStream(java.io.InputStream in, long size)
      Creates the stream that will at most read the given amount of bytes from the given stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close() 
      int read() 
      int read(byte[] b, int off, int len) 
      long skip(long n) 
      • Methods inherited from class java.io.InputStream

        available, mark, markSupported, read, reset
      • Methods inherited from class java.lang.Object

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

      • BoundedInputStream

        public BoundedInputStream(java.io.InputStream in,
                                  long size)
        Creates the stream that will at most read the given amount of bytes from the given stream.
        Parameters:
        in - the stream to read from
        size - the maximum amount of bytes to read
    • 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
      • close

        public void close()
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class java.io.InputStream
      • skip

        public long skip(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.InputStream
        Throws:
        java.io.IOException
        Since:
        1.20

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.