Class Apache5ResponseContent
java.lang.Object
java.io.InputStream
com.google.api.client.http.apache.v5.Apache5ResponseContent
- All Implemented Interfaces:
Closeable, AutoCloseable
Class that wraps an
HttpEntity's content InputStream
along with the ClassicHttpResponse that contains this entity. The main purpose is to be
able to close the response as well as the content input stream when close() is called,
in order to not break the existing contract with clients using apache v4 that only required them
to close the input stream to clean up all resources.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hc.core5.http.ClassicHttpResponseprivate final InputStream -
Constructor Summary
ConstructorsConstructorDescriptionApache5ResponseContent(InputStream wrappedStream, org.apache.hc.core5.http.ClassicHttpResponse response) -
Method Summary
-
Field Details
-
response
private final org.apache.hc.core5.http.ClassicHttpResponse response -
wrappedStream
-
-
Constructor Details
-
Apache5ResponseContent
public Apache5ResponseContent(InputStream wrappedStream, org.apache.hc.core5.http.ClassicHttpResponse response)
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
getResponse
org.apache.hc.core5.http.HttpResponse getResponse()
-