s-day10-IO-总结
This commit is contained in:
@@ -10,6 +10,7 @@ PrintStream(String fileName) 使用指定的文件名创建新的打印流,无
|
|||||||
常用方法:
|
常用方法:
|
||||||
print():直接输出内容,但不换行
|
print():直接输出内容,但不换行
|
||||||
println():直接输出内容,但换行
|
println():直接输出内容,但换行
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public class Demo12 {
|
public class Demo12 {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.inmind.print_stream04;
|
||||||
|
/*
|
||||||
|
IO流:字节流和字符流
|
||||||
|
字节输入输出流:
|
||||||
|
InputStream
|
||||||
|
OutputSteam
|
||||||
|
常用子类:
|
||||||
|
FileInputStream
|
||||||
|
FileOutputSteam
|
||||||
|
|
||||||
|
|
||||||
|
字符输入输出流:
|
||||||
|
Reader
|
||||||
|
Writer
|
||||||
|
常用子类:
|
||||||
|
FileReader
|
||||||
|
FileWriter
|
||||||
|
|
||||||
|
|
||||||
|
字节缓冲流:底层封装了个8192的数组提高读写效率
|
||||||
|
BufferedInputStream
|
||||||
|
BufferedOutputSteam
|
||||||
|
字符缓冲流:
|
||||||
|
BufferedReader
|
||||||
|
BufferedWriter
|
||||||
|
|
||||||
|
转换流:可以根据指定的编码方式进行读写数据(GBK UTF-8)
|
||||||
|
InputStreamReader
|
||||||
|
OutputSteamWriter
|
||||||
|
|
||||||
|
序列化流:
|
||||||
|
ObjectInputStream
|
||||||
|
ObjectOutputSteam
|
||||||
|
|
||||||
|
*/
|
||||||
|
public class Demo13 {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user