-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`System.in.read()` blocks until it faces the EOL character(s). This cannot be easily emulated because that behaviour is implemented in native code. The first attempt was sending -1 after the end of each text or line. This is an insufficient solution because -1 indicates the end of the stream. It seems that the blocking behaviour is mainly needed for code that uses Scanner (which uses `System.in.read(byte[], int, int)` internally.) Hence the -1 hack was replaced by an enhanced implementation of `read(byte[], int, int)` that returns the whole next line. Fixes #35.
- Loading branch information
1 parent
eb8f080
commit ec50f4d
Showing
2 changed files
with
182 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters