Finish the 14th day of it 18 Palm Java Foundation Course today:
Learning content:
Bufferedoutputstream: Buffer byte output stream
---------------------------------
1.Object--OutputStream-Filteroutputstreasm-BUFFEREDOUTPUTSTREAMSS
2. Use decorative mode
3.close ()
Bufferedinputstream: buffer byte input stream
-------------------------------
1.Object--InputStream-Filterinputstreasm-BUFFEREDINPUTSTREAMSS
2.close ()
Frees the system resources associated with it. Multiple shutdowns have no effect.
Close from outside to inside.
3.
4.
FileReader
FileWriter
BufferedReader
LineNumberReader
BufferedWriter
--------------------
FileInputStream
FileOutputStream
Bufferedinputstream
Bufferedoutputstream
byte array output stream: Bytearrayoutputstream
--------------------------------------
1.Object--OutputStream-Bytearrayoutputstream
2. Open up space in memory and store data. Not a buffer stream
3.
4.
byte array input stream: Bytearrayinputstream
--------------------------------------
1.Object--InputStream-Bytearrayinputstream
2.
3.
4.
byte array output stream: Bytearrayoutputstream
--------------------------------------
1.Object--OutputStream-Bytearrayoutputstream
2.
3.
4.
Use OutputStreamWriter to FileOutputStream Wrapper, write character data to file by wrapping stream.
InputStreamReader:
---------------------------------------
is a bridge from a byte stream to a stream of characters, reading a byte array and decoding (using the specified character set) into characters. The character set can be specified with a name or
The CharSet object is specified, or the platform is available by default.
Each read () method call causes the underlying byte stream to read one or more bytes of data. If you need to handle it efficiently, you can use it
BufferedReader for packaging.
1.Object----Reader--InputStreamReader
2. Not a buffer stream
3. When using, try to use BufferedReader to pack and improve the efficiency.
4.
OutputStreamWriter:
---------------------------------------
1.Object-----OutputStreamWriter
2. Not a buffer stream
3. When using, try to use BufferedReader to pack and improve the efficiency.
4.
Ss
File:
Directory:
---------------
1. Refers to the folder where the file resides.
2. Relative path. | ..
3.
Path: The address of the precise location file.
Problems encountered:
1. Character encoding problem,
2. Relative path and absolute path, file path and folder path
3. Byte array input/output stream differs from buffer
Questions that need help
1. Byte array input/output stream differs from buffer
This article from "Rookie Achievement Data Road" blog, reproduced please contact the author!
It 18 Palm Palm 14th Day Course Summary