Top Description Methods
org.apache.hc.core5.http.io

public Interface EofSensorWatcher

Imports
java.io.IOException, .InputStream

A watcher for EofSensorInputStream. Each stream will notify its watcher at most once.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if wrapped should be closed, false if it should be left alone
eofDetected
(InputStream
the underlying stream which has reached EOF
wrapped
)

Indicates that EOF is detected.

public boolean

Returns:

true if wrapped should be closed, false if it should be left alone
streamAbort
(InputStream
the underlying stream which has not reached EOF
wrapped
)

Indicates that the stream is aborted.

public boolean

Returns:

true if wrapped should be closed, false if it should be left alone
streamClosed
(InputStream
the underlying stream which has not reached EOF
wrapped
)

Indicates that the stream is closed.

Method Detail

eofDetectedback to summary
public boolean eofDetected(InputStream wrapped) throws IOException

Indicates that EOF is detected.

Parameters
wrapped:InputStream

the underlying stream which has reached EOF

Returns:boolean

true if wrapped should be closed, false if it should be left alone

Exceptions
IOException:
in case of an IO problem, for example if the watcher itself closes the underlying stream. The caller will leave the wrapped stream alone, as if false was returned.
streamAbortback to summary
public boolean streamAbort(InputStream wrapped) throws IOException

Indicates that the stream is aborted. This method will be called only if EOF was not detected before aborting. Otherwise, eofDetected is called.

This method will also be invoked when an input operation causes an IOException to be thrown to make sure the input stream gets shut down.

Parameters
wrapped:InputStream

the underlying stream which has not reached EOF

Returns:boolean

true if wrapped should be closed, false if it should be left alone

Exceptions
IOException:
in case of an IO problem, for example if the watcher itself closes the underlying stream. The caller will leave the wrapped stream alone, as if false was returned.
streamClosedback to summary
public boolean streamClosed(InputStream wrapped) throws IOException

Indicates that the stream is closed. This method will be called only if EOF was not detected before closing. Otherwise, eofDetected is called.

Parameters
wrapped:InputStream

the underlying stream which has not reached EOF

Returns:boolean

true if wrapped should be closed, false if it should be left alone

Exceptions
IOException:
in case of an IO problem, for example if the watcher itself closes the underlying stream. The caller will leave the wrapped stream alone, as if false was returned.