Java IO (not the general importance)
54. Stream in IO: Byte stream (InputStream, outputstream), character stream (Reader, Writer), conversion stream (InputStreamReader, outputstreamwriter), compressed stream (zipxxx (), Pipe flow (PipedInputStream, PipedOutputStream), memory flow (Bytearrayinputstream, Bytearrayoutputstream), Merge Stream (Sequenceinputstream), Data manipulation flow (DataInputStream, DataOutputStream), fallback stream (Pushbackinputstream, Pushbackreader).
55, the Java IO operation the corresponding steps: A use the file class to open a document, b by the byte stream or character stream to specify the location of the output; C read/write operation; d close the input/output stream.
56. File Common methods: File.separator, File (str), CreateNewFile (), delete (), exits (), isdirectory (), Length (), mkdir (), Public File[] Listfiles () (Lists all contents of the specified directory, lists the paths), public string[] List (lists all contents of the directory, lists only the names of the files, no full paths to the files), Renameto (file dest).
57, add the line \ r \ n.
58, add information at the end of the file, do not overwrite the original information: New FileInputStream (File,true), New FileWriter (File,true).
59, read the content:
InputStream class byte[] b=new byte[(int) file.length];
Input.read (b);
or while ((Temp=input. Read ())! =-1)
{
b[len]= (byte) temp;
++len;
}
FileReader class while ((Temp=reader.read ())!=-1)
{
ch[len]= (char) temp;
++len;
}
60, Write content: OutputStream class byte[] B=str.getbytes (); Out.writer (b). FileWriter class Out.write (str);
61, character stream and byte stream difference: Byte stream directly manipulate the file itself, character stream through the buffer indirectly manipulate files. All files in the hard disk or in the transmission of the form of byte stream, byte stream operation more extensive.
62, Edge Write while ((Temp=input.read ())!=-1) {out.write (temp);}.
63, the conversion stream OutputStreamWriter is the writer's subclass, InputStreamReader is the reader subclass.
64, Pipeline (inter-thread communication through the pipeline) Flow: PipedInputStream, PipedOutputStream (this class has a connect (PipedInputStream Pi) method to associate two).
65, printing flow: PrintStream, PrintWriter, you can
Basic knowledge of Java ignored (iv)