public class EofSensorInputStream extends InputStream
close() and EOF.
Primarily used to auto-release an underlying managed connection when the response
body is consumed or no longer needed.EofSensorWatcher| Constructor and Description |
|---|
EofSensorInputStream(InputStream in,
EofSensorWatcher watcher)
Creates a new EOF sensor.
|
public EofSensorInputStream(InputStream in, EofSensorWatcher watcher)
close is called.
Otherwise, the watcher decides whether the underlying stream
should be closed before detaching from it.in - the wrapped streamwatcher - the watcher for events, or null for
auto-close behavior without notificationpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic void abort()
throws IOException
close() which prevents
re-use of the underlying connection, if any. Calling this method
indicates that there should be no attempt to read until the end of
the stream.IOException - in case of an IO problem on closing the underlying streamCopyright © 2005–2021 The Apache Software Foundation. All rights reserved.