标签:缓冲流 写入 写文件 数据 生产 拷贝文件 col java 读取数据
Reader reader = new FileReader("readme.txt");
int data = reader.read(); // 读取一个字符,返回该字符代表的整数,若到达流的末尾,返回-1
Reader reader = new FileReader("readme.txt");
// 读取字符到数组中,返回读取的字符数,若到达流的末尾,返回-1 char[] chs = new char[2048]; int len = r.read(chs);
Writer writer = new FileWriter("dest.txt");
int x = ‘中‘; writer.write(x); // 写一个字符
Writer writer = new FileWriter("dest.txt")
char[] chs = {‘橙‘, ‘心‘, ‘橙‘, ‘意‘}; writer.write(chs); // 写一个字符数组
writer.write("小黑爱学习"); // 写入一个字符串
Reader reader = new FileReader("readme.txt");
Writer writer = new FileWriter("dest.txt");
int data = reader.read();
writer.write(data);
Reader reader = new FileReader("readme.txt");
Writer writer = new FileWriter("dest.txt");
char[] chs = new char[2048]; int len = reader.read(chs);
writer.write(chs);
标签:缓冲流 写入 写文件 数据 生产 拷贝文件 col java 读取数据
原文地址:https://www.cnblogs.com/sunbr/p/11619753.html