php    php100   android
当前位置:首页 » java.io包 »

Java.io.PrintStream类

评论  编辑

The java.util.PrintStream class adds functionality to another output stream, the ability to print representations of various data values conveniently.

类声明

以下是声明java.util.PrintStream class:

public class PrintStream
  extends FilterOutputStream
    implements Appendable, Closeable

字段域

Following are the fields for java.util.PrintStream class:

  • protected OutputStream out -- This is the output stream to be filtered.

类构造方法

S.N.构造方法 & 详细描述
1PrintStream(File file)
This creates a new print stream, without automatic line flushing, with the specified file.
2PrintStream(File file, String csn)
This creates a new print stream, without automatic line flushing, with the specified file and charset.
3PrintStream(OutputStream out)
This creates a new print stream.
4PrintStream(OutputStream out, boolean autoFlush)
This creates a new print stream.
5PrintStream(OutputStream out, boolean autoFlush, String encoding)
This creates a new print stream.
6PrintStream(String fileName)
This creates a new print stream, without automatic line flushing, with the specified file name.
7PrintStream(String fileName, String csn)
This creates a new print stream, without automatic line flushing, with the specified file name and charset.

类方法

S.N.方法 & 描述
1 PrintStream append(char c)
This method appends the specified character to this output stream.
2 PrintStream append(CharSequence csq)
This method appends the specified character sequence to this output stream.
3 PrintStream append(CharSequence csq, int start, int end)
This method appends a subsequence of the specified character sequence to this output stream.
4 boolean checkError()
This method flushes the stream and checks its error state.
5 protected void clearError()
This method clears the internal error state of this stream.
6 void close()
This method closes the stream.
7 void flush()
This method flushes the stream.
8 PrintStream format(Locale l, String format, Object... args)
This method writes a formatted string to this output stream using the specified format string and arguments.
9 PrintStream format(String format, Object... args)
This method writes a formatted string to this output stream using the specified format string and arguments.
10 void print(boolean b)
This method prints a boolean value.
11 void print(char c)
This method prints a character.
12 void print(char[] s)
This method prints an array of characters.
13 void print(double d)
This method prints a double-precision floating-point number..
14 void print(float f)
This method prints a floating-point number.
15 void print(int i)
This method prints an integer.
16 void print(long l)
This method prints a long integer.
17 void print(Object obj)
This method prints an object.
18 void print(String s)
This method Prints a string.
19 PrintStream printf(Locale l, String format, Object... args)
This is a convenience method to write a formatted string to this output stream using the specified format string and arguments.
20 PrintStream printf(String format, Object... args)
This is a convenience method to write a formatted string to this output stream using the specified format string and arguments.
21 void println()
This method terminates the current line by writing the line separator string.
22 void println(boolean x)
This method prints a boolean and then terminate the line.
23 void println(char x)
This method prints a character and then terminate the line.
24 void println(char[] x)
This method prints an array of characters and then terminate the line.
25 void println(double x)
This method prints a double and then terminate the line..
26 void println(float x)
This method Prints a float and then terminate the line.
27 void println(int x)
This method prints an integer and then terminate the line.
28 void println(long x)
This method prints a long and then terminate the line.
29 void println(Object x)
This method prints an Object and then terminate the line.
30 void println(String x)
This method prints a String and then terminate the line.
31 protected void setError()
This method sets the error state of the stream to true.
32 void write(byte[] buf, int off, int len)
This method writes len bytes from the specified byte array starting at offset off to this stream.
33 void write(int b)
This method writes the specified byte to this stream.

方法继承

此类从以下类继承了上面列出的方法

  • java.util.FilterOutputStream

  • java.util.Object


贡献/合作者

正在开放中...
 

评论(条)

  • 还没有评论!