Java file FileInputStream

xiaoxiao2021-03-06  69

File operation applet

http://www.25gy.com/myworks/streamcontrol[java].rar

This is a small program for the files I made, and there is a need.

Stream operation import java.io *;. Class FileStreamTest {public static void main (String [] args) {String filename; int ch = 0; filename = "gongtao.txt"; try {FileInputStream fis = new FileInputStream (filename) WHILE ((CH = fis.read ())! = - 1) {system.out.print ((char) ch);} fis.close ();} catch (ioexception e) {system.out.println e.tostring ());}}}

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

New Post(0)