Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BufferedInputStream.read() for values bigger than 0x7f #1922

Merged
merged 1 commit into from
Oct 7, 2020

Commits on Oct 7, 2020

  1. Fixed read value bigger than 0x7f via BufferedInputStream

    `read()` should return a value between `-1` and `255` and `-1` means `EOF`.
    
    When `buf(pos)` contains value bigger than `0x7f` for example `171.toByte` and
    makes `.toInt`, it converts this value to `-85` that can be regarded by enduser
    as `EOF` if he uses `< 0` condition.
    
    Unfortunately this bug hasn't got workaround on user side because when stream
    contains `0xff`, the `read()` returns `-1` and it is impossibly to distinguish
    the `EOF` and `0xff`.
    catap committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    7bc78b4 View commit details
    Browse the repository at this point in the history