Marcono1234 created IO-715:
------------------------------

             Summary: 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


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)

Reply via email to