public final class AwsChunkedEncodingInputStream extends SdkInputStream
| Constructor and Description |
|---|
AwsChunkedEncodingInputStream(InputStream in,
String headerSignature,
AwsChunkSigner chunkSigner,
AwsChunkedEncodingConfig config)
Creates a chunked encoding input stream initialized with the originating stream, an http request seed signature
and a signer that can sign a chunk of bytes according to a chosen algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
calculateStreamContentLength(long originalLength,
int signatureLength,
AwsChunkedEncodingConfig config)
Calculates the expected total length of signed payload chunked stream.
|
protected InputStream |
getWrappedInputStream() |
void |
mark(int readlimit)
The readlimit parameter is ignored.
|
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
reset()
Reset the stream, either by resetting the wrapped stream or using the
buffer created by this class.
|
long |
skip(long n) |
abort, abortIfNeeded, releaseavailable, close, readclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreleasepublic AwsChunkedEncodingInputStream(InputStream in, String headerSignature, AwsChunkSigner chunkSigner, AwsChunkedEncodingConfig config)
calculateStreamContentLength(long, int, AwsChunkedEncodingConfig).in - The original InputStream.headerSignature - The signature of the signed headers of the request. This will be used for
calculating the signature of the first chunk. Observe that the format of
this parameter should be a hex-encoded string.chunkSigner - The signer for each chunk of data, implementing the AwsChunkSigner interface.config - The configuration allows the user to customize chunk size and buffer size.
See AwsChunkedEncodingConfig for default values.public int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic boolean markSupported()
markSupported in class InputStreamInputStream.markSupported()public void mark(int readlimit)
mark in class InputStreampublic void reset()
throws IOException
reset in class InputStreamIOExceptionpublic static long calculateStreamContentLength(long originalLength,
int signatureLength,
AwsChunkedEncodingConfig config)
originalLength - The length of the datasignatureLength - The length of a calculated signature, dependent on which AwsChunkSigner is usedconfig - The chunked encoding config determines the size of the chunks. Use the same values as when
initializing the stream
AwsChunkedEncodingInputStream(InputStream, String, AwsChunkSigner, AwsChunkedEncodingConfig).protected InputStream getWrappedInputStream()
getWrappedInputStream in class SdkInputStreamCopyright © 2021. All rights reserved.