Package org.apache.commons.io.input
Class ObservableInputStream.Observer
- java.lang.Object
-
- org.apache.commons.io.input.ObservableInputStream.Observer
-
- Direct Known Subclasses:
MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver
- Enclosing class:
- ObservableInputStream
public abstract static class ObservableInputStream.Observer extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Observer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
closed()
Called to indicate, that theObservableInputStream
has been closed.(package private) void
data(byte[] pBuffer, int pOffset, int pLength)
Called to indicate, thatInputStream.read(byte[])
, orInputStream.read(byte[], int, int)
have been called, and are about to invoke data.(package private) void
data(int pByte)
Called to indicate, thatInputStream.read()
has been invoked on theObservableInputStream
, and will return a value.(package private) void
error(java.io.IOException pException)
Called to indicate, that an error occurred on the underlying stream.(package private) void
finished()
Called to indicate, that EOF has been seen on the underlying stream.
-
-
-
Method Detail
-
data
void data(int pByte) throws java.io.IOException
Called to indicate, thatInputStream.read()
has been invoked on theObservableInputStream
, and will return a value.- Parameters:
pByte
- The value, which is being returned. This will never be -1 (EOF), because, in that case,finished()
will be invoked instead.- Throws:
java.io.IOException
- if an i/o-error occurs
-
data
void data(byte[] pBuffer, int pOffset, int pLength) throws java.io.IOException
Called to indicate, thatInputStream.read(byte[])
, orInputStream.read(byte[], int, int)
have been called, and are about to invoke data.- Parameters:
pBuffer
- The byte array, which has been passed to the read call, and where data has been stored.pOffset
- The offset within the byte array, where data has been stored.pLength
- The number of bytes, which have been stored in the byte array.- Throws:
java.io.IOException
- if an i/o-error occurs
-
finished
void finished() throws java.io.IOException
Called to indicate, that EOF has been seen on the underlying stream. This method may be called multiple times, if the reader keeps invoking either of the read methods, and they will consequently keep returning EOF.- Throws:
java.io.IOException
- if an i/o-error occurs
-
closed
void closed() throws java.io.IOException
Called to indicate, that theObservableInputStream
has been closed.- Throws:
java.io.IOException
- if an i/o-error occurs
-
error
void error(java.io.IOException pException) throws java.io.IOException
Called to indicate, that an error occurred on the underlying stream.- Throws:
java.io.IOException
- if an i/o-error occurs
-
-