1. The string input stream now calls the data or line handler if there
is still data available after returning from the data or line
handler. These callbacks are scheduled on the event loop.
2. The reading of data is now throtteld so that calls to read or
readLine will not eagerly try to read from the wrapped input
stream. After each call to read the data handler is installed if
no more buffered data is available. Also when the data handler
is called the data handler on the wrapped input stream is
un-installed if no more data is required for the current data or
line handler.
One side effect of this change is that just reading from an input
stream obtained from a file is no longer possible. One will have to
set up a data handler callback of some kind before any calls to read
will return data. We can of cause change this to allow synchronous
usage of an input stream obtained from a file (maybe with an optional
argument to openInputStream).
Fixed a related throtteling issue with the chunked input stream.
R=ager@google.com
BUG=
TEST=
Review URL: http://codereview.chromium.org//8885032
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2310 260f80e4-7a28-3924-810f-c04153c831b5
Have both async and sync version for the file operations. The
thinking is that once you have used an async operation you will
not be allowed to use a sync one. Only sync versions currently
implemented.
Instead of having one input and one output stream associated with a
file we create new streams whenever needed. These get their own
underlying file descriptor so they do not interfere. This means
that FileStreams have to be explicitly closed.
R=sgjesse@google.com
BUG=
TEST=
Review URL: http://codereview.chromium.org//8399033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@819 260f80e4-7a28-3924-810f-c04153c831b5