Learn Java I / O fast 2 weeks, today I finally understand INPUTSTREAM and OUTPUTSTREAM, I've been considered "File" before, INPUTSTREAM is entering data to file, but why is Reader to enter data to file? Similarly, OutputStream is output data to file, but why is Writer (written) to output data to files? Suddenly realized: "Object (variable)" is the core, INPUTSTREAM is input to objects in the file, reader understands read file data to object; OutputStream is in the file, Writer understands into files data. For example: string s = "c: //1.txt"; file file = new file (s); bufferedinputstream IN = New bufferedInputStream (new fileInputstream (file)); system.out.println (in.Read () ); // read operation, data in the file to object in printstream out = new printStream (New Fileoutputstream (new filteroutputstream (file)); out.println ("nihao"); // Write operation, using object OUT Write Data to file file out () ut.close (); // This step is not available to the basic process of reading and writing programming in: 1 Generate file stream objects (the fileinputstream class should be used when reading the file, and the file should be Fileoutputstream class 2 Call the FileInputStream or FileOutputStream class to read and write the contents of read (), Write (int b), etc.). 3 Close the file (Close ()).