java_IO
2017-03-11 17:43:59 33 举报
AI智能生成
Java中一些IO类
作者其他创作
大纲/内容
流的操作规律
1>明确源和目的
数据源:就是需要读取,可以使用的俩个体系:InputStream,Reader
数据汇:就是需要写入,可以使用的俩个体系:OutputStream,Writer
2>操作的数据是否是纯文本?
如果是:数据源:Reader。数据汇:Writer
如果不是:数据源:InputStream,数据汇:OutputStream
/记住,只要一读取键盘录入,就用这句话。
BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bufw = new BufferedWriter(new OutputStreamWriter(System.out));
字节流
InputStream
FileInputStream
FilterInputStream
BufferedInputStream
DataInputStream
PushbakInputStream
ObjectInputStream
PipedInputStream
SequenceInputStream
StringBufferInputStream
ByteArrayInputStream
OutputStream
FileOutputStream
FilterOutputStream
BufferedOutputStream
DataOutputStream
PrintStream
ObjectOutputStream
PipedOutputStream
ByteArrayOutputStream
字符流
Reader
BufferedReader
InputStreamReader
FileReader
StringReader
PipedReader
ByteArrayReader
FilterReader
PushbackReader
Writer
BufferedWriter
OutputStreamWriter
FileWriter
PrinterWriter
StringWriter
PipeWriter
CharArrayWriter
FilterWriter
0 条评论
下一页