Package com.google.api.client.http
Class ConsumingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.google.api.client.http.ConsumingInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
This class in meant to wrap an
InputStream
so that all bytes in the steam are read and
discarded on InputStream.close()
. This ensures that the underlying connection has the
option to be reused.-
Field Summary
FieldsFields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, read, read, reset, skip
-
Field Details
-
closed
private boolean closed
-
-
Constructor Details
-
ConsumingInputStream
ConsumingInputStream(InputStream inputStream)
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-