Class RawMonitorInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.vfs2.util.RawMonitorInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

An InputStream that provides end-of-stream monitoring.

This is the same as MonitorInputStream but without the buffering.

Since:
2.5.0
  • Constructor Details

    • RawMonitorInputStream

      public RawMonitorInputStream(InputStream inputStream)
      Constructs a MonitorInputStream from the passed InputStream.
      Parameters:
      inputStream - The input stream to wrap.
  • Method Details

    • available

      public int available() throws IOException
      Returns 0 if the stream is at EOF, else the underlying inputStream will be queried.
      Overrides:
      available in class FilterInputStream
      Returns:
      The number of bytes that are available.
      Throws:
      IOException - if an error occurs.
    • close

      public void close() throws IOException
      Closes this input stream and releases any system resources associated with the stream.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class FilterInputStream
      Throws:
      IOException - if an error occurs.
    • getCount

      public long getCount()
      Gets the number of bytes read by this input stream.
      Returns:
      The number of bytes read by this input stream.
    • mark

      public void mark(int readLimit)
      Overrides:
      mark in class FilterInputStream
    • onClose

      protected void onClose() throws IOException
      Called after the stream has been closed. This implementation does nothing.
      Throws:
      IOException - if an error occurs.
    • read

      public int read() throws IOException
      Reads a character.
      Overrides:
      read in class FilterInputStream
      Returns:
      The character that was read as an integer.
      Throws:
      IOException - if an error occurs.
    • read

      public int read(byte[] buffer, int offset, int length) throws IOException
      Reads bytes from this input stream.
      Overrides:
      read in class FilterInputStream
      Parameters:
      buffer - A byte array in which to place the characters read.
      offset - The offset at which to start reading.
      length - The maximum number of bytes to read.
      Returns:
      The number of bytes read.
      Throws:
      IOException - if an error occurs.