Documentation for method
READ assembled from the following types:
method READ(IO::Handle: Int \bytes --> Buf)
Called whenever a read operation is performed on the handle. Receives the number of bytes requested to read. Returns a Buf with those bytes which can be used to either fill the decoder buffer or returned from reading methods directly. The result is allowed to have fewer than the requested number of bytes, including no bytes at all.
If you provide your own
.READ, you very likely need to provide your own
.EOF as well, for all the features to behave correctly.
The compiler may call
.EOF method any number of times during a read operation to ascertain whether a call to
.READ should be made. More bytes than necessary to satisfy a read operation may be requested from
.READ, in which case the extra data may be buffered by the IO::Handle or the decoder it's using, to fulfill any subsequent reading operations, without necessarily having to make another
multi method EOF(|)