进阶day10-IO的总结
This commit is contained in:
@@ -11,6 +11,42 @@ PrintStream(String fileName) 使用指定的文件名创建新的打印流,无
|
|||||||
常用方法:
|
常用方法:
|
||||||
print():直接输出内容,但不换行
|
print():直接输出内容,但不换行
|
||||||
println():直接输出内容,但换行
|
println():直接输出内容,但换行
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------
|
||||||
|
IO流总结:
|
||||||
|
IO流:字节流和字符流
|
||||||
|
字节输入输出流:
|
||||||
|
InputStream
|
||||||
|
OutputSteam
|
||||||
|
常用子类:
|
||||||
|
FileInputStream
|
||||||
|
FileOutputSteam
|
||||||
|
|
||||||
|
|
||||||
|
字符输入输出流:
|
||||||
|
Reader
|
||||||
|
Writer
|
||||||
|
常用子类:
|
||||||
|
FileReader
|
||||||
|
FileWriter
|
||||||
|
|
||||||
|
|
||||||
|
字节缓冲流:底层封装了个8192的数组提高读写效率
|
||||||
|
BufferedInputStream
|
||||||
|
BufferedOutputSteam
|
||||||
|
字符缓冲流:
|
||||||
|
BufferedReader
|
||||||
|
BufferedWriter
|
||||||
|
|
||||||
|
转换流:可以根据指定的编码方式进行读写数据(GBK UTF-8)
|
||||||
|
InputStreamReader
|
||||||
|
OutputSteamWriter
|
||||||
|
|
||||||
|
序列化流:
|
||||||
|
ObjectInputStream
|
||||||
|
ObjectOutputSteam
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public class Demo14 {
|
public class Demo14 {
|
||||||
//修改掉sout的打印位置
|
//修改掉sout的打印位置
|
||||||
|
|||||||
Reference in New Issue
Block a user