You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2021/09/26 15:30:00 UTC
[jira] [Commented] (IO-715) ReaderInputStream does not mention
behavior regarding CharsetEncoder.reset()
[ https://issues.apache.org/jira/browse/IO-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17420314#comment-17420314 ]
Gary D. Gregory commented on IO-715:
------------------------------------
[~Marcono1234]
Feel free to offer up a PR on GitHub with your changes.
> ReaderInputStream does not mention behavior regarding CharsetEncoder.reset()
> ----------------------------------------------------------------------------
>
> Key: IO-715
> URL: https://issues.apache.org/jira/browse/IO-715
> Project: Commons IO
> Issue Type: Bug
> Components: Streams/Writers
> Affects Versions: 2.8.0
> Reporter: Marcono1234
> Priority: Minor
>
> Neither the class documentation of {{org.apache.commons.io.input.ReaderInputStream}} nor the documentation of the constructors taking {{CharsetEncoder}} arguments describe whether [{{CharsetEncoder.reset()}}|https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/CharsetEncoder.html#reset()] is called.
> Since calling {{reset()}} is part of the _encoding operation_ (see {{CharsetEncoder}} documentation), it should at least be specified whether this method is called or not.
> Additionally it _might_ make sense to call {{reset()}} (though this might be a breaking change?) because encoding from a new (\?) reader with an already used encoder which is not reset might lead to unexpected and incorrect results.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)