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.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Aborts this stream.
|
int |
available() |
void |
close() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
mark, markSupported, reset, skip
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 InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public 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.