IO
Java · 18 notes
- 3.1 Comparison of the Three I/O Modelshistorical
BIO, NIO, and AIO differ in blocking behavior, thread organization, and completion reporting. These notes compare them through server connections and request handling.
- 3.2 Multithreaded Server Implemented with BIOhistorical
Multithreaded Server Implemented with BIO: Traditionally, server-side programming uses BIO.
- AIOhistorical
Java AIO uses asynchronous file and socket channels. These notes examine asynchronous read and write organization through the related classes and examples.
- 3.4 BIOhistorical
BIO reads and writes through input and output streams organized as bytes or characters. These notes introduce blocking I/O through those concepts.
- Bufferhistorical
Buffer usage commonly follows writing, flip, reading, and clear or compact. These notes use its internal properties to explain state changes.
- 3.6 Server Implemented with NIOhistorical
NIO server examples cover read and write events and connection closure, including how read return values indicate connection state.
- AIO Serverhistorical
Server and client examples demonstrate Java asynchronous-I/O server programming and how connections and reads and writes complete.
- Basic Streamshistorical
InputStream.read reads bytes and returns -1 at the end of the stream. These notes examine basic stream behavior through single-byte and bulk reads.
- Channelhistorical
Data can both be read from a channel and written to a channel, while stream reading and writing are usually one-way.
- 3.10 Serialization Protocolhistorical
Serialization converts objects or data structures into bytes for storage or transmission. These notes use examples such as ByteBuffer to examine protocol organization.
- File Streamshistorical
Files can be read and written through byte or character streams. Examples with FileOutputStream, FileWriter, and related APIs cover writing, reading, and metadata access.
- Fileshistorical
Files provides operations for existence checks, directory creation, copying, moving, deletion, and recursive traversal. These notes record them through code examples.
- Heartbeat Mechanismhistorical
Heartbeats help servers clear idle channels and clients detect disconnections and decide whether to reconnect. These notes record both sides' handling.
- BIO Serverhistorical
Server and client examples demonstrate BIO programming and the organization of blocking connections, reads, and writes.
- 3.15 NIOhistorical
NIO organizes reads and writes around channels and buffers rather than BIO byte and character streams. These notes introduce usage through those components.
- Packet Protocolhistorical
Application protocols must distinguish message boundaries in TCP data. These notes examine packet-protocol design through data examples and sticky-packet behavior.
- Pathhistorical
Path represents a file-system path, with capabilities related to File. These notes use examples to record path creation and manipulation.
- NIO Serverhistorical
Client and server code demonstrate Java NIO programming and how Channel, Buffer, and Selector cooperate on connections and data.