Ask a low-level input stream problem. . .

xiaoxiao2021-03-05  21

code show as below:

Import java.io. *; / ** * @Author user * @version 1.0 * / public class fileinputstreamDemo {

public static void main (String args []) {if (args.length = 1!) {System.err.println ( "Syntax - FileInputStreamDemo file"); return;} try {InputStream fileInput = new FileInputStream (args [0] Int Data = fileinput.read (); while (data! = -1) {system.out.write (data); data = fileinput.read ();} fileinput.close ();} catch (ooException ie) {System.err.Println ("I / O Error -" IOE);}}}

Question: When I enter a file, I can't display the content or not display all the contents of the file. Which one can tell me?

I am a rookie ~~

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

New Post(0)