Class ExceptionInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class ExceptionInputStream
    extends org.apache.commons.io.input.ProxyInputStream
    InputStream wrapper that throws an exception after a configurable number of bytes have been read from the stream or when the end of the stream is reached.
    • Constructor Detail

      • ExceptionInputStream

        public ExceptionInputStream​(InputStream in)
      • ExceptionInputStream

        public ExceptionInputStream​(InputStream in,
                                    int maxBytes)
    • Method Detail

      • read

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

        public int read​(byte[] b)
                 throws IOException
        Overrides:
        read in class org.apache.commons.io.input.ProxyInputStream
        Throws:
        IOException
      • read

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