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:
Closeable,Flushable,Appendable,AutoCloseable
- Since:
- 3.1
- Author:
- Eike Stepper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MessageDigestThe message digest associated with this stream.Fields inherited from class java.io.FilterWriter
out -
Constructor Summary
ConstructorsConstructorDescriptionDigestWriter(Writer writer, MessageDigest digest) Creates a digest writer, using the specified writer and message digest. -
Method Summary
Modifier and TypeMethodDescriptionReturns the message digest associated with this writer.voidon(boolean on) Turns the digest function on or off.voidsetMessageDigest(MessageDigest digest) Associates the specified message digest with this writer.toString()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) voidMethods inherited from class java.io.FilterWriter
close, flush
-
Field Details
-
digest
The message digest associated with this stream.
-
-
Constructor Details
-
DigestWriter
Creates a digest writer, using the specified writer and message digest.- Parameters:
writer- the writer.digest- the message digest to associate with this writer.
-
-
Method Details
-
getMessageDigest
Returns the message digest associated with this writer.- Returns:
- the message digest associated with this writer.
- See Also:
-
setMessageDigest
Associates the specified message digest with this writer.- Parameters:
digest- the message digest to be associated with this writer.- See Also:
-
write
- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
- Overrides:
writein classFilterWriter- Throws:
IOException
-
on
public 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.
-
toString
Prints a string representation of this digest output stream and its associated message digest object.
-