|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
org.logi.crypto.io.HashInputStream
This InputStream hashes everything read from an underlying OutputStream and then returns the data. The hash can be retrieved by calling getFingerprint().
HashOutputStream
Field Summary |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
HashInputStream(java.io.InputStream in)
Creates a new HashInputStream around in . |
|
HashInputStream(java.io.InputStream in,
HashState hashState)
Creates a new HashInputStream around in . |
Method Summary | |
int |
available()
Returns the number of bytes that can be read from this input stream without blocking. |
Fingerprint |
getFingerprint()
Return a fingerprint of all data read so far. |
boolean |
markSupported()
Returns false. |
int |
read()
Reads the next byte of data from this input stream. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from this input stream into an array of bytes. |
long |
skip(long n)
Skips over and discards n bytes of data from the input stream. |
Methods inherited from class java.io.FilterInputStream |
close, mark, read, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HashInputStream(java.io.InputStream in, HashState hashState)
in
. hashState
will be used to
calculate fingerprints.
public HashInputStream(java.io.InputStream in)
in
. A new SHA1State will be used to
calculate fingerprints.
SHA1State
Method Detail |
public Fingerprint getFingerprint()
public int read() throws java.io.IOException
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
The actual number of bytes read is returned or -1 if the end of the stream is reached.
java.io.IOException
public long skip(long n) throws java.io.IOException
The skipped data will NOT be incorporated into the hash.
java.io.IOException
public int available() throws java.io.IOException
java.io.IOException
public boolean markSupported()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |