[jboss-remoting-issues] [JBoss JIRA] Resolved: (JBREM-1252) Problems in ReaderInputStream
Ron Sigal (JIRA)
jira-events at lists.jboss.org
Fri Nov 12 19:49:36 EST 2010
[ https://jira.jboss.org/browse/JBREM-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ron Sigal resolved JBREM-1252.
------------------------------
Assignee: Ron Sigal
Resolution: Done
> Problems in ReaderInputStream
> -----------------------------
>
> Key: JBREM-1252
> URL: https://jira.jboss.org/browse/JBREM-1252
> Project: JBoss Remoting
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: stream
> Affects Versions: 3.1.0.Beta2
> Reporter: Ron Sigal
> Assignee: Ron Sigal
> Fix For: 3.1.0.Beta3
>
>
> There are a couple of little problems in org.jboss.remoting3.stream.ReaderInputStream:
> 1. When you enter read(), you want byteBuffer to be in "read" mode, so byteBuffer.flip() should be added to the constructor.
> 2. When you enter flip(), you want charBuffer to be in "read" mode, so charBuffer.flip() should be added to the constructor.
> 3. In fill()
>
> try {
> final int cnt = reader.read(charBuffer);
> if (cnt == -1) {
> return false;
> }
> doesn't tmake sense. It could be that you've transferred some bytes to byteBuffer and now reader is empty. When changed to
> try {
> final int cnt = reader.read(charBuffer);
> if (cnt == -1) {
> // return false;
> return byteBuffer.position() > 0;
> }
> the code works.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-remoting-issues
mailing list