|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
java.security.DigestOutputStream
public class DigestOutputStream
| Field Summary | |
|---|---|
protected MessageDigest |
digest
|
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
DigestOutputStream(OutputStream stream,
MessageDigest digest)
|
|
| Method Summary | |
|---|---|
MessageDigest |
getMessageDigest()
Returns the MessageDigest which the receiver uses when computing the hash. |
void |
on(boolean on)
Enables or disables the digest function (default is on). |
void |
setMessageDigest(MessageDigest digest)
Sets the MessageDigest which the receiver will use when computing the hash. |
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
void |
write(byte[] b,
int off,
int len)
Writes count bytes from the byte array
buffer starting at offset to this
FilterOutputStream. |
void |
write(int b)
Writes the specified byte oneByte to this
FilterOutputStream. |
| Methods inherited from class java.io.FilterOutputStream |
|---|
close, flush, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected MessageDigest digest
| Constructor Detail |
|---|
public DigestOutputStream(OutputStream stream,
MessageDigest digest)
| Method Detail |
|---|
public MessageDigest getMessageDigest()
public void setMessageDigest(MessageDigest digest)
digest - MessageDigest the digest to use when computing the hash.MessageDigest,
on(boolean)
public void write(int b)
throws IOException
FilterOutputStreamoneByte to this
FilterOutputStream. Only the low order byte of oneByte is
written. This implementation writes the byte to the target OutputStream.
write in class FilterOutputStreamb - the byte to be written
IOException - If an error occurs attempting to write to this
FilterOutputStream.
public void write(byte[] b,
int off,
int len)
throws IOException
FilterOutputStreamcount bytes from the byte array
buffer starting at offset to this
FilterOutputStream. This implementation writes the buffer
to the target OutputStream.
write in class FilterOutputStreamb - the buffer to be writtenoff - offset in buffer to get byteslen - number of bytes in buffer to write
IOException - If an error occurs attempting to write to this
FilterOutputStream.public void on(boolean on)
on - boolean true if the digest should be computed, and false
otherwise.MessageDigestpublic String toString()
toString in class Object
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||