Class sun.server.misc.TextOutputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.misc.TextOutputStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----java.io.FilterOutputStream
                   |
                   +----sun.server.misc.TextOutputStream

public class TextOutputStream
extends FilterOutputStream
An efficient buffered output stream for writing ASCII text in native text file format. Note that this class is *not* MT-safe.

Variable Index

 o buf
The buffer where output data is stored.
 o count
The number of bytes in the buffer.
 o lineSeparator
The line separator.

Constructor Index

 o TextOutputStream(OutputStream)
Creates a new output stream with a default buffer size.
 o TextOutputStream(OutputStream, int)
Creates a new output stream with the specified buffer size.

Method Index

 o flush()
Flushes the output stream.
 o main(String[])
 o print(int)
Prints an integer value.
 o print(long)
Prints a long value.
 o print(String)
Prints an ASCII string.
 o println()
Prints a line separator.
 o println(int)
Prints an integer value followed by a line separator.
 o println(long)
Prints a long value followed by a line separator.
 o println(String)
Prints an ASCII string followed by a line separator.
 o write(byte[], int, int)
Writes an array of bytes to the output stream.
 o write(int)
Writes a byte of data to the output stream.

Variables

 o buf
  protected byte buf[]
The buffer where output data is stored.
 o count
  protected int count
The number of bytes in the buffer.
 o lineSeparator
  protected final static String lineSeparator
The line separator.

Constructors

 o TextOutputStream
  public TextOutputStream(OutputStream out,
                          int size)
Creates a new output stream with the specified buffer size.
Parameters:
out - the output stream
size - the buffer size
 o TextOutputStream
  public TextOutputStream(OutputStream out)
Creates a new output stream with a default buffer size.
Parameters:
out - the output stream

Methods

 o write
  public void write(int b) throws IOException
Writes a byte of data to the output stream. This method will block until the byte is actually written.
Parameters:
b - the byte to be written
Throws: IOException
if an I/O error has occurred
Overrides:
write in class FilterOutputStream
 o write
  public void write(byte b[],
                    int off,
                    int len) throws IOException
Writes an array of bytes to the output stream. This method will block until all the bytes have been written.
Parameters:
b - the bytes to be written
off - the start offset of the bytes
len - the number of bytes to write
Throws: IOException
if an I/O error has occurred
Overrides:
write in class FilterOutputStream
 o print
  public void print(String s) throws IOException
Prints an ASCII string.
Parameters:
s - the string to be printed
Throws: IOException
if an i/o error has occurred
 o print
  public void print(int i) throws IOException
Prints an integer value.
Parameters:
i - the integer to be printed
Throws: IOException
if an i/o error has occurred
 o print
  public void print(long l) throws IOException
Prints a long value.
Parameters:
l - the long to be printed
Throws: IOException
if an i/o error has occurred
 o println
  public void println(String s) throws IOException
Prints an ASCII string followed by a line separator.
Parameters:
s - the string to be printed
Throws: IOException
if an i/o error has occurred
 o println
  public void println(int i) throws IOException
Prints an integer value followed by a line separator.
Parameters:
i - the integer to be printed
Throws: IOException
if an i/o error has occurred
 o println
  public void println(long l) throws IOException
Prints a long value followed by a line separator.
Parameters:
l - the long to be printed
Throws: IOException
if an i/o error has occurred
 o println
  public void println() throws IOException
Prints a line separator.
 o flush
  public void flush() throws IOException
Flushes the output stream.
Throws: IOException
if an I/O error has occurred
Overrides:
flush in class FilterOutputStream
 o main
  public static void main(String args[]) throws Exception

All Packages  Class Hierarchy  This Package  Previous  Next  Index