标签:txt string stream col tput cep while not close
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class FileOutputStreamTest { public static void main(String[] args) { try { var fis = new FileInputStream("FileInputStreamTest.java"); var fos = new FileOutputStream("output.txt"); { var buf = new byte[32]; var hasRead = 0; while ((hasRead = fis.read(buf)) > 0){ fos.write(buf, 0, hasRead); } } fis.close(); fos.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
learning java FileOutputStream
标签:txt string stream col tput cep while not close
原文地址:https://www.cnblogs.com/lianghong881018/p/11302425.html