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

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

Open
davidmoten opened this issue Sep 29, 2015 · 4 comments
Labels

Comments

@davidmoten
Copy link
Contributor

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?

@akarnokd akarnokd added the bug label Sep 29, 2015
@akarnokd
Copy link
Member

Sounds like a good idea to me.

@abersnaze
Copy link
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.

@abersnaze
Copy link
Contributor

@davidmoten is this still an issue?

@davidmoten
Copy link
Contributor Author

@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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants