NIO
java IO 的核心是流Stream拇涤。
輸入流和輸出流
字節(jié)流和字符流
讀數(shù)據(jù)的邏輯:
- open a stream
- while more information
- read information
- close the stream
寫(xiě)數(shù)據(jù)的邏輯:
- open a stream
- while more information
- write information
- close the stream
節(jié)點(diǎn)流和過(guò)濾流
Decorator設(shè)計(jì)模式
InputStream
FilterInputStream
BufferedInputStream
A container for data of a specific primitive type.
A buffer is a linear, finite sequence of elements of a specific primitive type. Aside from its content, the essential properties of a buffer are its capacity, limit, and position
A buffer's limit is the index of the first element that should not be read or written.