Length returns the number of bytes that can be
read from the steam
Read blocks until enough bytes were written to the
stream.
Flush unblocks Read
refactoring: names