Interface TerminalSource
- All Known Implementing Classes:
FileTerminalSource,MemoryTerminalSource
public interface TerminalSource
A growing stream of raw terminal bytes, read by absolute byte offset.
The bytes are exactly what the producer's terminal wrote, escape sequences included. The server never decodes them.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe largest number of bytes oneread(long, int)returns. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidcopyTo(OutputStream out) Copies every byte still held, oldest first, up to the end at the time of the call.read(long fromOffset, int maxBytes) Reads up tomaxBytesbytes starting atfromOffset.
-
Field Details
-
MAX_READ_BYTES
The largest number of bytes oneread(long, int)returns.- See Also:
-
-
Method Details
-
read
Reads up tomaxBytesbytes starting atfromOffset.When
fromOffsetequals the end, the chunk is empty. When it is past the end, the chunk is empty, itsnextis itsend, and that is belowfromOffset, which the endpoint answers with416. When it is no longer held, the chunk istruncatedand starts at the oldest offset held. When the backing store has disappeared, the chunk is empty andgone, withnextandendequal tofromOffset.- Parameters:
fromOffset- The offset to read from, at least 0.maxBytes- The most bytes to return, clamped to 0-MAX_READ_BYTES.- Returns:
- The chunk.
- Throws:
IOException- If the backing store could not be read.
-
copyTo
Copies every byte still held, oldest first, up to the end at the time of the call.If the oldest bytes have been overwritten, the copy starts at the oldest offset held and the gap is skipped.
- Parameters:
out- The stream to write to.- Throws:
IOException- If the source could not be read or the stream written.
-