| java.lang.Object java.io.OutputStream org.apache.harmony.luni.util.SHAOutputStream
SHAOutputStream | public class SHAOutputStream extends OutputStream implements Cloneable(Code) | | This class implements the Secure Hash Algorithm, SHA-1. The specification can
be found at http://csrc.ncsl.nist.gov/fips/fip180-1.txt
|
Constructor Summary | |
public | SHAOutputStream() Constructs a new SHAOutputStream. | public | SHAOutputStream(byte[] state) Constructs a new MD5OutputStream with the given initial state.
Parameters: state - The initial state of the output stream. |
Method Summary | |
public Object | clone() Answers a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver. | public int[] | getHash() Returns an int array (length = 5) with the SHA value of the bytes written
to the receiver. | public byte[] | getHashAsBytes() Returns a byte array (length = 20) with the SHA value of the bytes
written to the receiver. | public byte[] | getHashAsBytes(boolean pad) Returns a byte array (length = 20) with the SHA value of the bytes
written to the receiver. | public void | reset() Reset this SHAOutputStream to the state it was before any byte was
written to it. | public String | toString() | public void | write(byte[] buffer, int off, int len) Writes len bytes from this byte array
buffer starting at offset off to the
SHAOutputStream. | public void | write(int b) Writes the specified byte b to this OutputStream. |
SHAOutputStream | public SHAOutputStream()(Code) | | Constructs a new SHAOutputStream.
|
SHAOutputStream | public SHAOutputStream(byte[] state)(Code) | | Constructs a new MD5OutputStream with the given initial state.
Parameters: state - The initial state of the output stream. This is what will bereturned by getHash() if write() is never called. throws: IllegalArgumentException - if state.length is less than 16. |
clone | public Object clone() throws CloneNotSupportedException(Code) | | Answers a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
Classes which wish to support cloning must specify that they implement
the Cloneable interface, since the native implementation checks for this.
a complete copy of this object throws: CloneNotSupportedException - if the component does not implementthe interface Cloneable |
getHash | public int[] getHash()(Code) | | Returns an int array (length = 5) with the SHA value of the bytes written
to the receiver.
The 5 ints that form the SHA value of the bytes written tothe receiver |
getHashAsBytes | public byte[] getHashAsBytes()(Code) | | Returns a byte array (length = 20) with the SHA value of the bytes
written to the receiver.
The bytes that form the SHA value of the bytes written tothe receiver |
getHashAsBytes | public byte[] getHashAsBytes(boolean pad)(Code) | | Returns a byte array (length = 20) with the SHA value of the bytes
written to the receiver.
The bytes that form the SHA value of the bytes written tothe receiver |
reset | public void reset()(Code) | | Reset this SHAOutputStream to the state it was before any byte was
written to it.
|
write | public void write(byte[] buffer, int off, int len)(Code) | | Writes len bytes from this byte array
buffer starting at offset off to the
SHAOutputStream. The internal buffer used to compute SHA is updated, and
the incremental computation of SHA is also performed.
Parameters: buffer - the buffer to be written Parameters: off - offset in buffer to get bytes Parameters: len - number of bytes in buffer to write |
write | public void write(int b)(Code) | | Writes the specified byte b to this OutputStream. Only the
low order byte of b is written.
Parameters: b - the byte to be written |
|
|