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.FilterOutputStream
This 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 void
print(java.lang.String s)
Prints a String.void
println()
Prints a newline.void
println(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.IOException
Prints 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.IOException
Prints 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.IOException
Prints 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
-
-