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| 构造器和说明 |
|---|
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 在类中 InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read 在类中 InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read 在类中 InputStreamIOExceptionpublic int available()
throws IOException
available 在类中 InputStreamIOExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 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 © 2023. All rights reserved.