Skip to content

InputStreamDecrypter read() is not InputStream compliant #10

@spheroid

Description

@spheroid

The InputStream.read() spec states:

The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned.

The current InputStreamDecrypter.read() currently behaves incorrectly as it returns signed ints which both:

  1. Breaks every implementation that relies on this behavior.
  2. Masks the -1 return value as it cannot be distinguished from 0xff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions