org.apache.james.jdkim.canon
Class DigestOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.james.jdkim.canon.DigestOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class DigestOutputStream
- extends FilterOutputStream
DigestOutputStream is used as a filter stream or as the ending stream in
order to calculate a digest of a stream.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DigestOutputStream
public DigestOutputStream(MessageDigest md)
DigestOutputStream
public DigestOutputStream(MessageDigest md,
OutputStream out)
write
public void write(int arg0)
throws IOException
- Overrides:
write
in class FilterOutputStream
- Throws:
IOException
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Overrides:
write
in class FilterOutputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class FilterOutputStream
- Throws:
IOException
flush
public void flush()
throws IOException
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class FilterOutputStream
- Throws:
IOException
write
public void write(byte[] b)
throws IOException
- Overrides:
write
in class FilterOutputStream
- Throws:
IOException
getDigest
public byte[] getDigest()
- Returns:
- the stream digest as a byte array
Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.