-
Bug
-
Resolution: Done
-
Major
-
3.1.0.Beta2
-
None
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)
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)
the code works.