Package software.amazon.awssdk.utils
Class LookaheadInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
software.amazon.awssdk.utils.LookaheadInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
A wrapper for an
InputStream
that allows peek()
ing one byte ahead in the stream. This is useful for
detecting the end of a stream without actually consuming any data in the process (e.g. so the stream can be passed to
another library that doesn't handle end-of-stream as the first byte well).-
Constructor Summary
-
Method Summary
Methods inherited from class java.io.FilterInputStream
close, markSupported, read
-
Constructor Details
-
LookaheadInputStream
-
-
Method Details
-
peek
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classFilterInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
mark
in classFilterInputStream
-
reset
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-