public class TreeHashInputStream extends SdkFilterInputStream
Modifier and Type | Field and Description |
---|---|
private int |
byteOffset |
private java.util.List<byte[]> |
checksums
The checksums of megabyte-sized parts of the bytes streamed.
|
private boolean |
closed |
private java.security.DigestInputStream |
digestInputStream
The private DigestInputStream we use to wrap the source input stream and
compute a client-side checksum for every part of the message.
|
private static int |
MB |
Constructor and Description |
---|
TreeHashInputStream(java.io.InputStream in) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private void |
digestPart()
Digests the current part of the message, if necessary, and resets digest
state.
|
java.util.List<byte[]> |
getChecksums()
Returns the list of one-megabyte checksums for this input stream.
|
java.lang.String |
getTreeHash() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
abort, abortIfNeeded, available, isMetricActivated, mark, markSupported, release, reset, skip
private final java.security.DigestInputStream digestInputStream
private final java.util.List<byte[]> checksums
private boolean closed
private int byteOffset
private static final int MB
public TreeHashInputStream(java.io.InputStream in) throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmException
public java.util.List<byte[]> getChecksums() throws java.io.IOException
java.io.IOException
- If the stream hasn't been closed.public java.lang.String getTreeHash() throws java.io.IOException
java.io.IOException
public int read() throws java.io.IOException
read
in class SdkFilterInputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class SdkFilterInputStream
java.io.IOException
private void digestPart()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class SdkFilterInputStream
java.io.IOException