A stream of bytes. Streams may be read-only, write-only or read-write and may support seeking. New stream types should inherit from one of the subtypes defined below.
A readable stream. Subtypes of ReaderT should define at least the :read(@ReaderT,@Std.Address.T,@Std.Integer.SmallT) method, default implementations for the other read methods are provided in this module.
A writable stream. Subtypes of WriterT should define at least the :write(@WriterT,@Std.Address.T,@Std.Integer.SmallT) method, default implementations for the other write methods are provided in this module.
A seekable stream. Subtypes of SeekerT should define at least the :seek(@SeekerT,@Std.Integer.SmallT) method, default implementations for the other seek methods are provided in this module.
Links rd and wr so that any input available on rd is written to wr.
The default implementation creates a new thread and so rd should block until input is available.
Reads the next line of text from rd and returns it as a string without the carriage return.
This methods differs from t:readx("\n", 0) in that it treats "\r\n" as a single carriage return.
Reads bytes from rd until either max bytes have been read, or a byte in terminal has been read, or rd is empty.
Returns the bytes read as a string including the final byte if it is in terminal.
Passing 0 for max will ignore the number of bytes read.
If terminal="", then only the number of bytes is checked
If both max= 0 and terminal="" then all the remaining bytes from rd are returned.
Reads bytes from rd until either max bytes have been read, or a byte in terminal has been read, or rd is empty.
Returns the bytes read as a string excluding the final byte if it is in terminal.
Passing 0 for max will ignore the number of bytes read.
If terminal="", then only the number of bytes is checked
If both max= 0 and terminal="" then all the remaining bytes from rd are returned.