Package com.adobe.testing.s3mock.s3.util
Class AbstractAwsInputStream
-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public abstract class AbstractAwsInputStream extends InputStream
-
-
Field Summary
Fields Modifier and Type Field Description private final LongdecodedLengthprivate final LongreadDecodedLengthprivate final Stringchecksumprivate final ChecksumAlgorithmalgorithmprivate final Integerchunks
-
Method Summary
Modifier and Type Method Description final LonggetDecodedLength()final LonggetReadDecodedLength()final StringgetChecksum()final ChecksumAlgorithmgetAlgorithm()final IntegergetChunks()Unitclose()Integerread(ByteArray b, Integer off, Integer len)Bulk read that delegates the first byte to the single-byte read so that all chunk-boundary parsing (chunk headers, signatures, trailing checksum, end-of-stream detection) stays in one place, then copies the remaining payload bytes of the current chunk directly from source. -
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getDecodedLength
final Long getDecodedLength()
-
getReadDecodedLength
final Long getReadDecodedLength()
-
getChecksum
final String getChecksum()
-
getAlgorithm
final ChecksumAlgorithm getAlgorithm()
-
read
Integer read(ByteArray b, Integer off, Integer len)
Bulk read that delegates the first byte to the single-byte read so that all chunk-boundary parsing (chunk headers, signatures, trailing checksum, end-of-stream detection) stays in one place, then copies the remaining payload bytes of the current chunk directly from source.
The copy never crosses a chunk boundary (it is bounded by chunkLength), so all delimiter, CRLF and checksum handling remains the responsibility of read. A single call therefore returns at most the bytes remaining in the current chunk, which is a valid short read.
-
-
-
-