| write() | ใช้เขียนข้อมูล ลงไฟล์ โดยเขียนข้อมูลจากรหัส ascii ที่กำหนด |
|---|
method:write ( int_ascii );
return type:void
content:ใช้เขียนข้อมูล ลงไฟล์ โดยเขียนข้อมูลจากรหัส ascii ที่กำหนด
example:String filename = new String ( "C:/bamboo.txt" ); FileInputStream file_input_stream = new FileInputStream ( filename ); String filename_new = new String ( "C:/labcode.txt" ); FileOutputStream file_output_stream = new FileOutputStream ( filename_new ); int buffer = 0; while ( ( buffer = file_input_stream.read () ) != -1 ) { file_output_stream.write ( buffer ); }