Package org.apache.commons.io.input
Class ObservableInputStream.Observer
java.lang.Object
org.apache.commons.io.input.ObservableInputStream.Observer
- Direct Known Subclasses:
- MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver,- MessageDigestInputStream.MessageDigestMaintainingObserver,- TimestampedObserver
- Enclosing class:
- ObservableInputStream
Abstracts observer callback for 
ObservableInputStreams.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclosed()Called to indicate that theObservableInputStreamhas been closed.voiddata(byte[] buffer, int offset, int length) Called to indicate thatInputStream.read(byte[]), orInputStream.read(byte[], int, int)have been called, and are about to invoke data.voiddata(int value) Called to indicate, thatInputStream.read()has been invoked on theObservableInputStream, and will return a value.voiderror(IOException exception) Called to indicate that an error occurred on the underlying stream.voidfinished()Called to indicate that EOF has been seen on the underlying stream.
- 
Constructor Details- 
Observerpublic Observer()Constructs a new instance for subclasses.
 
- 
- 
Method Details- 
closedCalled to indicate that theObservableInputStreamhas been closed.- Throws:
- IOException- if an I/O error occurs.
 
- 
dataCalled to indicate thatInputStream.read(byte[]), orInputStream.read(byte[], int, int)have been called, and are about to invoke data.- Parameters:
- buffer- The byte array, which has been passed to the read call, and where data has been stored.
- offset- The offset within the byte array, where data has been stored.
- length- The number of bytes, which have been stored in the byte array.
- Throws:
- IOException- if an I/O error occurs.
 
- 
dataCalled to indicate, thatInputStream.read()has been invoked on theObservableInputStream, and will return a value.- Parameters:
- value- The value, which is being returned. This will never be -1 (EOF), because, in that case,- finished()will be invoked instead.
- Throws:
- IOException- if an I/O error occurs.
 
- 
errorCalled to indicate that an error occurred on the underlying stream.- Parameters:
- exception- the exception to throw
- Throws:
- IOException- if an I/O error occurs.
 
- 
finishedCalled 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:
- IOException- if an I/O error occurs.
 
 
-