Row delimiters can be obtained by means of the method in Java.
The system property name is Line.separator.
The row separators for different platforms are different.
windows7:\r\n
MacOS: \ n
--------------------------------
System.getproperty ("Line.separator"); //Execute system Property name/
FileWriter: No buffer function
---------------------------
itself does not add any functionality to the inherited OutputStreamWriter.
Write () {
Write the data directly to the file.
Sun.nio.cs.StreamEncoder.write (...);
}
BufferedWriter:
----------------------------------
The writer is wrapped, which defines a buffer, which provides writing to a single character, char[], and a string method.
Improve write efficiency.
Hierarchy tree structure: Object-------BufferedWriter
Flushbuffer (): Clears the buffer and writes the buffer data to the destination.
Close () method: Contains Flushbuffer ().
The buffer must be combined with a stream before it can be used.
The function of convection is enhanced on the basis of flow.
FileReader
-----------------
Inheritance tree: Object--InputStreamReader----FileReader
Read () {
Inputstreamreader.read () {
Sun.nio.cs.StreamDecoder.read ();
}
}
BufferedReader
------------------
Inheritance tree: Object--BufferedReader----LineNumberReader
Read () {
char[] Cbuf = ...;
CBUF[XXX] = c;
Fill ();
return C;
}
The flow is introduced to avoid frequent access to physical files.
byte[] bytes = new byte[1023];
byte[] B2 = bytes;
bytes = NULL;
Flush ()//cleanup
Refresh () //refreshing
Clear ()//clear
BYTE stream:
The basic operation is the same as the character stream class.
But it can not only manipulate characters, but also manipulate other media files (JPG.MP3.AVI ... )
OutputStream: Output stream (byte stream)
---------------------------------
is the parent class of Filteroutputstream and FileOutputStream.
InputStream: Input stream (byte stream)
---------------------------------
It's FilterInputStream and FileInputStream's parent class.
Metadata: Metadata that describes the data.
-----------------------------------
In Java, metadata exists in Java code in the form of tags, and the presence of metadata tags does not affect the compilation and execution of program code, but is used to generate other files or needles that know the description of the running code at run time.
"DAY13" Java 13th day I/O learning Note