Class java.io.StringBufferPrintStream
All Packages This Package Previous Next
Class java.io.StringBufferPrintStream
java.lang.Object
|
+----java.io.OutputStream
|
+----java.io.FilterOutputStream
|
+----java.io.PrintStream
|
+----java.io.StringBufferPrintStream
-
public class
StringBufferPrintStream
-
extends PrintStream
File output stream constructed from a StringBuffer.
This lets you create an output stream and capture its output in
a String or StringBuffer.
-
Author:
-
James Gosling
-
StringBufferPrintStream(StringBuffer)
-
Creates an output file given a StringBuffer.
-
StringBufferPrintStream()
-
/**
Creates an output file and a StringBuffer.
-
close()
-
Closes the stream.
-
getStringBuffer()
-
Return the string buffer associated with the output stream.
-
print(String)
-
Prints a String.
-
print(char[])
-
Prints an array of characters.
-
toString()
-
Return the contents of the output stream as a String
-
write(int)
-
Write a byte.
StringBufferPrintStream
public StringBufferPrintStream(StringBuffer fsb)
-
Creates an output file given a StringBuffer.
StringBufferPrintStream
public StringBufferPrintStream()
-
/**
Creates an output file and a StringBuffer.
Use toString or getStringBuffer to fetch the results.
write
public void write(int b)
-
Write a byte.
-
Overrides:
-
write in class PrintStream
close
public void close()
-
Closes the stream.
-
Overrides:
-
close in class FilterOutputStream
toString
public String toString()
-
Return the contents of the output stream as a String
-
Overrides:
-
toString in class Object
getStringBuffer
public StringBuffer getStringBuffer()
-
Return the string buffer associated with the output stream.
print
public void print(String s)
-
Prints a String.
-
Overrides:
-
print in class PrintStream
print
public void print(char s[])
-
Prints an array of characters.
-
Overrides:
-
print in class PrintStream
All Packages This Package Previous Next