FileOutputStream example

xiaoxiao2021-04-01  228

// Demonstrate FileOutputStreamimport java.io *;. Class FileOutputStreamDemo {public static void main (String [] args) throws Exception {String source = "Now is the time for all good men / n" "to come to the aid of their Country / n " " and pat their due Taxes. "; BYTE BUF [] = source.getbytes (); outputstream f0 = new fileoutputstream (" file1.txt "); for (int i = 0; i

OutputStream F1 = New FileOutputStream ("file2.txt"); f1.write (buf); f1.close ();

OutputStream F2 = New FileOutputStream ("file3.txt"); f2.write (buf, buf.length-buf.length / 4, buf.length / 4); f2.close ();}}

转载请注明原文地址:https://www.9cbs.com/read-131160.html

New Post(0)