public class DigestInputStreamNoSkip extends java.security.DigestInputStream
DigestInputStream does not update the digest
when performing a skip operation. Since this is completely useless in
most situations, the following implementation remedies this.| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
skip_read_buffer
Read buffer used by the skip method.
|
static int |
SKIP_READ_BUFFER_SIZE
Buffer size to use when read skipping.
|
| Constructor and Description |
|---|
DigestInputStreamNoSkip(java.io.InputStream stream,
java.security.MessageDigest digest)
Construct a
DigestInputStream with the skip method
overridden. |
| Modifier and Type | Method and Description |
|---|---|
void |
mark(int readlimit) |
boolean |
markSupported() |
void |
reset() |
long |
skip(long n) |
public static final int SKIP_READ_BUFFER_SIZE
protected byte[] skip_read_buffer
public DigestInputStreamNoSkip(java.io.InputStream stream, java.security.MessageDigest digest)
DigestInputStream with the skip method
overridden.stream - input stream to digestdigest - digest implementation to usepublic boolean markSupported()
markSupported in class java.io.FilterInputStreampublic void mark(int readlimit)
mark in class java.io.FilterInputStreampublic void reset() throws java.io.IOException
reset in class java.io.FilterInputStreamjava.io.IOExceptionpublic long skip(long n) throws java.io.IOException
skip in class java.io.FilterInputStreamjava.io.IOExceptionCopyright © 2011–2023. All rights reserved.