Class ObservableInputStream

    • Constructor Detail

      • ObservableInputStream

        public ObservableInputStream​(InputStream pProxy)
        Creates a new ObservableInputStream for the given InputStream.
        Parameters:
        pProxy - the input stream to proxy
    • Method Detail

      • removeAllObservers

        public void removeAllObservers()
        Removes all Observers.
      • read

        public int read​(byte[] pBuffer)
                 throws IOException
        Description copied from class: ProxyInputStream
        Invokes the delegate's read(byte[]) method.
        Overrides:
        read in class ProxyInputStream
        Parameters:
        pBuffer - the buffer to read the bytes into
        Returns:
        the number of bytes read or EOF if the end of stream
        Throws:
        IOException - if an I/O error occurs
      • read

        public int read​(byte[] pBuffer,
                        int pOffset,
                        int pLength)
                 throws IOException
        Description copied from class: ProxyInputStream
        Invokes the delegate's read(byte[], int, int) method.
        Overrides:
        read in class ProxyInputStream
        Parameters:
        pBuffer - the buffer to read the bytes into
        pOffset - The start offset
        pLength - The number of bytes to read
        Returns:
        the number of bytes read or -1 if the end of stream
        Throws:
        IOException - if an I/O error occurs
      • consume

        public void consume()
                     throws IOException
        Reads all data from the underlying InputStream, while notifying the observers.
        Throws:
        IOException - The underlying InputStream, or either of the observers has thrown an exception.