org.freehep.util.io
Class UniquePrintStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
org.freehep.util.io.UniquePrintStream
- All Implemented Interfaces:
- Closeable, Flushable, Appendable, FinishableOutputStream
public class UniquePrintStream
- extends PrintStream
- implements FinishableOutputStream
The UniquePrintStream keeps Strings buffered in sorted order, but any
duplicates are removed. This stream can be used to print error messages
exactly once. When finish is called all messages are printed.
It only acts on the println(String) method, any other method will print
directly.
- Version:
- $Id: UniquePrintStream.java 8584 2006-08-10 23:06:37Z duns $
- Author:
- Mark Donszelmann
Method Summary |
void |
finish()
Finishes the current outputstream (compresses, flushes, caluclates CRC)
and writes whatever is left in the buffers, but does not close the
stream. |
void |
println(String s)
|
Methods inherited from class java.io.PrintStream |
append, append, append, append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UniquePrintStream
public UniquePrintStream(OutputStream out)
- Create a Unique Print Stream.
- Parameters:
out
- stream to write
println
public void println(String s)
- Overrides:
println
in class PrintStream
finish
public void finish()
- Description copied from interface:
FinishableOutputStream
- Finishes the current outputstream (compresses, flushes, caluclates CRC)
and writes whatever is left in the buffers, but does not close the
stream.
- Specified by:
finish
in interface FinishableOutputStream
Copyright © 2000-2007 FreeHEP. All Rights Reserved.