package com.soar.stream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class Demo7_Chinese {
public static void main(String[] args) throws IOException {
FileOutputStream fos = new FileOutputStream("zzz.txt");
fos.write("我读书少,你不要骗我".getBytes());
fos.write("\r\n".getBytes());
fos.close();
}
private static void readChinese() throws FileNotFoundException, IOException {
FileInputStream fis = new FileInputStream("yyy.txt");
byte[] arr = new byte[2];
int len;
while((len = fis.read(arr)) != -1){
System.out.println(new String(arr,0,len));
}
fis.close();
}
}