Buffer Sequences
Every I/O operation is ultimately about transferring bytes. A write moves the bytes produced by your program into the outside world; a read moves bytes from the outside world into your program. Buffer sequences describe the storage within your program that those bytes are written from and read into. They are designed with the following criteria in mind:
-
They should be compatible with data types used by native I/O systems.
-
They should enable fast transport (contiguous storage).
-
They should be easy to use from within your program.
What This Section Covers
-
Contiguous Buffers —
const_bufferandmutable_buffer, the two handle types that refer to one contiguous region of storage that you own. -
Composite Buffers — the concepts that describe sequences of those handles.
-
System I/O Integration — how a sequence maps onto the structures that native I/O systems expect.
-
Buffer Algorithms — counting bytes, slicing, copying, and consuming those sequences.
-
Rationale — why the handles use
void*, why sequences are concepts, and why those concepts require bidirectional iteration.