private static final class FastByteArrayOutputStream.FastByteArrayInputStream extends UpdateMessageDigestInputStream
InputStream
that reads from a given
FastByteArrayOutputStream
.Modifier and Type | Field and Description |
---|---|
private java.util.Iterator<byte[]> |
buffersIterator |
private byte[] |
currentBuffer |
private int |
currentBufferLength |
private FastByteArrayOutputStream |
fastByteArrayOutputStream |
private int |
nextIndexInCurrentBuffer |
private int |
totalBytesRead |
Constructor and Description |
---|
FastByteArrayInputStream(FastByteArrayOutputStream fastByteArrayOutputStream)
Create a new
FastByteArrayOutputStreamInputStream backed
by the given FastByteArrayOutputStream . |
Modifier and Type | Method and Description |
---|---|
int |
available() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long n) |
private void |
updateCurrentBufferLength() |
void |
updateMessageDigest(java.security.MessageDigest messageDigest)
Update the message digest with the remaining bytes in this stream.
|
void |
updateMessageDigest(java.security.MessageDigest messageDigest,
int len)
Update the message digest with the next len bytes in this stream.
|
private final FastByteArrayOutputStream fastByteArrayOutputStream
private final java.util.Iterator<byte[]> buffersIterator
@Nullable private byte[] currentBuffer
private int currentBufferLength
private int nextIndexInCurrentBuffer
private int totalBytesRead
public FastByteArrayInputStream(FastByteArrayOutputStream fastByteArrayOutputStream)
FastByteArrayOutputStreamInputStream
backed
by the given FastByteArrayOutputStream
.public int read()
read
in class java.io.InputStream
public int read(byte[] b)
read
in class java.io.InputStream
public int read(byte[] b, int off, int len)
read
in class java.io.InputStream
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public int available()
available
in class java.io.InputStream
public void updateMessageDigest(java.security.MessageDigest messageDigest)
updateMessageDigest
in class UpdateMessageDigestInputStream
messageDigest
- the message digest to updatepublic void updateMessageDigest(java.security.MessageDigest messageDigest, int len)
updateMessageDigest
in class UpdateMessageDigestInputStream
messageDigest
- the message digest to updatelen
- how many bytes to read from this stream and use to update the message digestprivate void updateCurrentBufferLength()