The three implementations of this method differ in how they handle end of stream:
- Native implementation will throw TypeError exception because read_nonblock with exception set to false returns nil which gets passed to <<.
- C extension returns 0 which is indistinguishable from 0 which it returns when EAGAIN error is returned so the caller is unable to differentiate between those two cases.
- JRuby version seems to be throwing EOFError
The three implementations of this method differ in how they handle end of stream: