摘要:
FileOutputStream fos = new FileOutputStream ("zzz.txt"); fos.write("我读书少,你不要骗我".getBytes()); //将字符串转换为字节数组,然后写出 fos.write("\r\n"getBytes()); //换到下一行 f 阅读全文
摘要:
FileInputStream fis = new FileInputStream ("yyy.txt"); byte[] arr = new byte[2];//定义字节数组空间为2 int len; while(len = fis.read(arr) != -1){ //将字节流读取到字节数组中 阅读全文