com.sun.javatest.util
Class TextStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by com.sun.javatest.util.TextStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

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.


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
TextStream(java.io.OutputStream out)
          Creates a new TextStream.
TextStream(java.io.OutputStream out, boolean autoflush)
          Creates a new TextStream.
 
Method Summary
 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.
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 stream
autoflush - 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


Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.