read one byte at a time. Fixes #4