加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090326194556/http://developer.android.com:80/reference/java/security/DigestOutputStream.html
public class

DigestOutputStream

extends FilterOutputStream
java.lang.Object
   ↳ java.io.OutputStream
     ↳ java.io.FilterOutputStream
       ↳ java.security.DigestOutputStream

Summary

Fields
protected MessageDigest digest
[Expand]
Inherited Fields
From class java.io.FilterOutputStream
Public Constructors
DigestOutputStream(OutputStream stream, MessageDigest digest)
Public Methods
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(int b)
Writes the specified byte oneByte to this FilterOutputStream.
void write(byte[] b, int off, int len)
Writes count bytes from the byte array buffer starting at offset to this FilterOutputStream.
[Expand]
Inherited Methods
From class java.io.FilterOutputStream
From class java.io.OutputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.io.Flushable

Fields

protected MessageDigest digest

Public Constructors

public DigestOutputStream (OutputStream stream, MessageDigest digest)

Public Methods

public MessageDigest getMessageDigest ()

Returns the MessageDigest which the receiver uses when computing the hash.

Returns
  • MessageDigest the digest the receiver uses when computing the hash.

public void on (boolean on)

Enables or disables the digest function (default is on).

Parameters
on boolean true if the digest should be computed, and false otherwise.
See Also

public void setMessageDigest (MessageDigest digest)

Sets the MessageDigest which the receiver will use when computing the hash.

Parameters
digest MessageDigest the digest to use when computing the hash.

public String toString ()

Returns a string containing a concise, human-readable description of the receiver.

Returns
  • String a printable representation for the receiver.

public void write (int b)

Writes the specified byte oneByte to this FilterOutputStream. Only the low order byte of oneByte is written. This implementation writes the byte to the target OutputStream.

Parameters
b the byte to be written
Throws
IOException

public void write (byte[] b, int off, int len)

Writes count bytes from the byte array buffer starting at offset to this FilterOutputStream. This implementation writes the buffer to the target OutputStream.

Parameters
b the buffer to be written
off offset in buffer to get bytes
len number of bytes in buffer to write
Throws
IOException