Package org.eclipse.net4j.util.io
Class DigestWriter
- java.lang.Object
- 
- java.io.Writer
- 
- java.io.FilterWriter
- 
- org.eclipse.net4j.util.io.DigestWriter
 
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.io.Flushable,- java.lang.Appendable,- java.lang.AutoCloseable
 
 public class DigestWriter extends java.io.FilterWriter- Since:
- 3.1
- Author:
- Eike Stepper
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.security.MessageDigestdigestThe message digest associated with this stream.
 - 
Constructor SummaryConstructors Constructor Description DigestWriter(java.io.Writer writer, java.security.MessageDigest digest)Creates a digest writer, using the specified writer and message digest.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.MessageDigestgetMessageDigest()Returns the message digest associated with this writer.voidon(boolean on)Turns the digest function on or off.voidsetMessageDigest(java.security.MessageDigest digest)Associates the specified message digest with this writer.java.lang.StringtoString()Prints a string representation of this digest output stream and its associated message digest object.voidwrite(char[] cbuf, int off, int len)voidwrite(int c)voidwrite(java.lang.String str, int off, int len)
 
- 
- 
- 
Method Detail- 
getMessageDigestpublic java.security.MessageDigest getMessageDigest() Returns the message digest associated with this writer.- Returns:
- the message digest associated with this writer.
- See Also:
- setMessageDigest(java.security.MessageDigest)
 
 - 
setMessageDigestpublic void setMessageDigest(java.security.MessageDigest digest) Associates the specified message digest with this writer.- Parameters:
- digest- the message digest to be associated with this writer.
- See Also:
- getMessageDigest()
 
 - 
writepublic void write(int c) throws java.io.IOException- Overrides:
- writein class- java.io.FilterWriter
- Throws:
- java.io.IOException
 
 - 
writepublic void write(char[] cbuf, int off, int len) throws java.io.IOException- Overrides:
- writein class- java.io.FilterWriter
- Throws:
- java.io.IOException
 
 - 
writepublic void write(java.lang.String str, int off, int len) throws java.io.IOException- Overrides:
- writein class- java.io.FilterWriter
- Throws:
- java.io.IOException
 
 - 
onpublic void on(boolean on) Turns the digest function on or off. The default is on. When it is on, a call to one of thewritemethods results in an update on the message digest. But when it is off, the message digest is not updated.- Parameters:
- on- true to turn the digest function on, false to turn it off.
 
 - 
toStringpublic java.lang.String toString() Prints a string representation of this digest output stream and its associated message digest object.- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-