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.
-
buf
- The buffer where output data is stored.
-
count
- The number of bytes in the buffer.
-
lineSeparator
- The line separator.
-
TextOutputStream(OutputStream)
- Creates a new output stream with a default buffer size.
-
TextOutputStream(OutputStream, int)
- Creates a new output stream with the specified buffer size.
-
flush()
- Flushes the output stream.
-
main(String[])
-
-
print(int)
- Prints an integer value.
-
print(long)
- Prints a long value.
-
print(String)
- Prints an ASCII string.
-
println()
- Prints a line separator.
-
println(int)
- Prints an integer value followed by a line separator.
-
println(long)
- Prints a long value followed by a line separator.
-
println(String)
- Prints an ASCII string followed by a line separator.
-
write(byte[], int, int)
- Writes an array of bytes to the output stream.
-
write(int)
- Writes a byte of data to the output stream.
buf
protected byte buf[]
- The buffer where output data is stored.
count
protected int count
- The number of bytes in the buffer.
lineSeparator
protected final static String lineSeparator
- The line separator.
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
TextOutputStream
public TextOutputStream(OutputStream out)
- Creates a new output stream with a default buffer size.
- Parameters:
- out - the output stream
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
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
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
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
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
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
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
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
println
public void println() throws IOException
- Prints a line separator.
flush
public void flush() throws IOException
- Flushes the output stream.
- Throws: IOException
- if an I/O error has occurred
- Overrides:
- flush in class FilterOutputStream
main
public static void main(String args[]) throws Exception
All Packages Class Hierarchy This Package Previous Next Index