Android
java.security
public class

java.security.DigestOutputStream

java.lang.Object
java.io.OutputStream Closeable Flushable
java.io.FilterOutputStream
java.security.DigestOutputStream

Summary

Fields

protected      MessageDigest  digest   
Fields inherited 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.
Methods inherited from class java.io.FilterOutputStream
Methods inherited from class java.io.OutputStream
Methods inherited from class java.lang.Object
Methods inherited from interface java.io.Closeable
Methods inherited from interface java.io.Flushable

Details

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
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56