Package com.adobe.testing.s3mock.util
Class AbstractAwsInputStream
java.lang.Object
java.io.InputStream
com.adobe.testing.s3mock.util.AbstractAwsInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
AwsChunkedDecodingChecksumInputStream,AwsUnsignedChunkedDecodingChecksumInputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChecksumAlgorithmprotected Stringprotected static final byte[]protected longprotected intprotected static final byte[]protected final longprotected static final byte[]protected longprotected final InputStream -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAwsInputStream(InputStream source, long decodedLength) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected booleanendsWith(ByteBuffer buffer, byte[] endSequence) protected voidprotected byte[]readUntil(byte[] endSequence) Reads this stream until the byte sequence was found.protected voidsetChunkLength(byte[] hexLengthBytes) Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
CRLF
protected static final byte[] CRLF -
DELIMITER
protected static final byte[] DELIMITER -
CHECKSUM_HEADER
protected static final byte[] CHECKSUM_HEADER -
readDecodedLength
protected long readDecodedLength -
source
-
chunkLength
protected long chunkLength -
checksum
-
algorithm
-
chunks
protected int chunks -
decodedLength
protected final long decodedLength
-
-
Constructor Details
-
AbstractAwsInputStream
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
readUntil
Reads this stream until the byte sequence was found.- Parameters:
endSequence- The byte sequence to look for in the stream. The source stream is read until the last bytes read are equal to this sequence.- Returns:
- The bytes read before the end sequence started.
- Throws:
IOException
-
endsWith
-
setChunkLength
protected void setChunkLength(byte[] hexLengthBytes) -
extractAlgorithmAndChecksum
- Throws:
IOException
-
getChecksum
-
getAlgorithm
-