Package com.sun.javatest.util
Class TextStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- com.sun.javatest.util.TextStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class TextStream extends java.io.FilterOutputStreamThis class implements an output stream that has additional methods for printing. It is similar to java.io.PrintStream except that it does not swallow exceptions.
-
-
Constructor Summary
Constructors Constructor Description TextStream(java.io.OutputStream out)Creates a new TextStream.TextStream(java.io.OutputStream out, boolean autoflush)Creates a new TextStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprint(java.lang.String s)Prints a String.voidprintln()Prints a newline.voidprintln(java.lang.String s)Prints a string followed by a newline.
-
-
-
Constructor Detail
-
TextStream
public TextStream(java.io.OutputStream out)
Creates a new TextStream.- Parameters:
out- the output stream
-
TextStream
public TextStream(java.io.OutputStream out, boolean autoflush)Creates a new TextStream.- Parameters:
out- the output streamautoflush- set to true to flush the stream after each newline character is written
-
-
Method Detail
-
print
public void print(java.lang.String s) throws java.io.IOExceptionPrints a String.- Parameters:
s- the String to be printed- Throws:
java.io.IOException- if there is a problem writing to the stream
-
println
public void println() throws java.io.IOExceptionPrints a newline.- Throws:
java.io.IOException- if there is a problem writing to the stream
-
println
public void println(java.lang.String s) throws java.io.IOExceptionPrints a string followed by a newline.- Parameters:
s- the String to be printed- Throws:
java.io.IOException- if there is a problem writing to the stream
-
-