Package jadex.commons

Class ProxyInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    ProtectedInputStream

    public abstract class ProxyInputStream
    extends java.io.FilterInputStream
    The proxy input stream is similar to filter input stream but overrides read(byte[]) to redirect it to the same input stream method.
    • Field Summary

      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      ProxyInputStream​(java.io.InputStream proxy)
      Constructs a new ProxyInputStream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int read​(byte[] data)
      Invokes the delegate's read(byte[]) method.
      • Methods inherited from class java.io.FilterInputStream

        available, close, mark, markSupported, read, read, reset, skip
      • 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, toString, wait, wait, wait
    • Constructor Detail

      • ProxyInputStream

        public ProxyInputStream​(java.io.InputStream proxy)
        Constructs a new ProxyInputStream.
        Parameters:
        proxy - The input stream to which calls are delegated.
    • Method Detail

      • read

        public int read​(byte[] data)
                 throws java.io.IOException
        Invokes the delegate's read(byte[]) method.
        Overrides:
        read in class java.io.FilterInputStream
        Parameters:
        data - The buffer to read the bytes into.
        Returns:
        The number of bytes read or -1 if the end of stream.
        Throws:
        java.io.IOException - if an I/O error occurs.