Description
This issue was originally filed by [email protected]
Current inputstream interface:
interface InputStream {
/**
* Reads [len] bytes into [buffer] buffer starting at [offset] offset.
* [callback] callback is invoked on completion unless it is null.
*/
bool read(List<int> buffer, int offset, int len, void callback());
/**
* Reads data from the stream into a buffer until a given [pattern] occurs and
* hands that buffer over as an input to the registered [callback].
* The callback is not invoked if a read error occurs.
*/
void readUntil(List<int> pattern, void callback(List<int> buffer));
}
In an example I'm doing a file read, and this is seems odd to me.
* This is an async operation - what does the return bool mean?
* The callback should take a parameter (int numBytesRead).
I suppose there is a dual in outputstream.
/Karl