Skip to content

StringObservable.decode should call onError when buffer not empty on completion #32

Description

@davidmoten

At the moment if StringObservable.decode is called on a stream of byte[] and the source stream completes with bytes left over in the buffer (more is required before a string can be emitted) then the observable effectively hangs (onCompleted is not called). Because this situation cannot be distinguished from the source not completing or hanging I'd like to see StringObservable.decode call onError with some custom exception type that can be ignored if people wish using the normal means.

Are people ok with me submitting a PR for this?

Activity

  1. akarnokd commented on Sep 29, 2015

    @akarnokd
    Member

    Sounds like a good idea to me.

  2. abersnaze commented on Sep 30, 2015

    @abersnaze
    Contributor

    It's not entirely obviously but it is actually the default behavior to replace malformed chars with a question mark char. It is possible to pass in a custom CharsetDecoder with different malformed handling. See http://docs.oracle.com/javase/7/docs/api/java/nio/charset/CodingErrorAction.html.

    Consider just adding an overload that makes it easy to set that enum.

  3. abersnaze commented on Mar 17, 2016

    @abersnaze
    Contributor

    @davidmoten is this still an issue?

  4. davidmoten commented on Mar 17, 2016

    @davidmoten
    ContributorAuthor

    @abersnaze I imagine so. I like your suggestion. I'll pop this on my list of things to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions