Package org.projectnessie.client.rest.io
Class CapturingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.projectnessie.client.rest.io.CapturingInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Captures the first 2kB of the input in case the response is not parsable, to provide a better
error message to the user.
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skipMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
CapturingInputStream
-
-
Method Details
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
capture
Consumes the input stream up to 2048 bytes and returns the captured content as a string. This method does not close the input stream. -
captured
Returns the captured content so far, as a string. This method does not consume and does not close the input stream.
-