Class ConnectionClosingInputStream
java.lang.Object
java.io.InputStream
net.shibboleth.shared.spring.httpclient.resource.ConnectionClosingInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
A wrapper around the entity content
InputStream represented by an HttpResponse
that closes the stream and the HttpResponse when close() is invoked.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hc.core5.http.ClassicHttpResponseHTTP response that is being wrapped.private final InputStreamStream owned by the given HTTP response. -
Constructor Summary
ConstructorsConstructorDescriptionConnectionClosingInputStream(org.apache.hc.core5.http.ClassicHttpResponse httpResponse) Constructor. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
response
@Nonnull private final org.apache.hc.core5.http.ClassicHttpResponse responseHTTP response that is being wrapped. -
stream
Stream owned by the given HTTP response.
-
-
Constructor Details
-
ConnectionClosingInputStream
public ConnectionClosingInputStream(@Nonnull org.apache.hc.core5.http.ClassicHttpResponse httpResponse) throws IOException Constructor.- Parameters:
httpResponse- HTTP method that was invoked- Throws:
IOException- if there is a problem getting the entity content input stream from the response
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int readLimit) - Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-