public abstract static class ObservableInputStream.Observer
extends java.lang.Object
ObservableInputStream
s.Constructor and Description |
---|
Observer() |
Modifier and Type | Method and Description |
---|---|
void |
closed()
Called to indicate that the
ObservableInputStream has been closed. |
void |
data(byte[] buffer,
int offset,
int length)
Called to indicate that
InputStream.read(byte[]) , or InputStream.read(byte[], int, int) have
been called, and are about to invoke data. |
void |
data(int value)
Called to indicate, that
InputStream.read() has been invoked on the ObservableInputStream ,
and will return a value. |
void |
error(java.io.IOException exception)
Called to indicate that an error occurred on the underlying stream.
|
void |
finished()
Called to indicate that EOF has been seen on the underlying stream.
|
public void closed() throws java.io.IOException
ObservableInputStream
has been closed.java.io.IOException
- if an I/O error occurs.public void data(byte[] buffer, int offset, int length) throws java.io.IOException
InputStream.read(byte[])
, or InputStream.read(byte[], int, int)
have
been called, and are about to invoke data.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.java.io.IOException
- if an I/O error occurs.public void data(int value) throws java.io.IOException
InputStream.read()
has been invoked on the ObservableInputStream
,
and will return a value.value
- The value, which is being returned. This will never be -1 (EOF), because, in that case,
finished()
will be invoked instead.java.io.IOException
- if an I/O error occurs.public void error(java.io.IOException exception) throws java.io.IOException
exception
- the exception to throwjava.io.IOException
- if an I/O error occurs.public void finished() throws java.io.IOException
java.io.IOException
- if an I/O error occurs.Copyright © 2010 - 2023 Adobe. All Rights Reserved