ForwardLineReader
Reads the complete lines appended to a file after a byte offset.
The region is a file the CLI is still writing. Lines are delimited by 0x0A; because no byte of a multi-byte UTF-8 sequence is ever 0x0A, splitting on the raw byte never severs a character, so each line's byte slice decodes as UTF-8 independently. A single trailing \r is stripped so a CRLF-terminated line reads the same as an LF-terminated one — the same rules BackwardLineReader reads a tail by, so a transcript read once at the end and then followed says the same thing either way.
Torn-final-line rule: bytes after the last 0x0A are a line whose terminating newline has not been written yet. They are left unread and the returned cursor stops before them, so the next read starts at that line and sees it whole once the writer finishes it. An entry is therefore never shown half-written, and never shown twice.
The cursor is the whole of what a follower has to remember: it is a byte position into an append-only file, so feeding it back is what makes reading resumable without holding on to anything that was read.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ForwardLineReader.type