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.ClassicHttpResponse
private 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:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
mark
in classInputStream
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
getResponse
org.apache.hc.core5.http.HttpResponse getResponse()
-