Package ucar.httpservices
Class HTTPMethodStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- ucar.httpservices.HTTPMethodStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class HTTPMethodStream extends FilterInputStream implements Closeable
The goal of this class is to allow other classes to access the data stream associated with a method response. It tracks the method and the session to allow them to be closed when the stream hits eof. It also guarantees that any remaining unconsumed input is consumed. Note that this class is not public in the package. Note that this code now includes the equivalent of Tom Kunicki's proposed pull request, but with the HTTPMethod close extension he proposes but does not implement. Pull request: https://github.com/tkunicki-usgs/thredds/commit/3b750ec0016a137db66336adeac421a9202b9d30 Is this class needed in httpclient 4.5+ any more?
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this input stream and releases any system resources associated with the stream; closes the method also.boolean
isClosed()
-
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Method Detail
-
close
public void close() throws IOException
Closes this input stream and releases any system resources associated with the stream; closes the method also.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
- if an I/O error occurs; but not if close is called twice.
-
isClosed
public boolean isClosed()
-
-