IoSessionInputStream.read() does not properly return -1 to indicate
end-of-stream.
----------------------------------------------------------------------------------
Key: DIRMINA-226
URL: http://issues.apache.org/jira/browse/DIRMINA-226
Project: Directory MINA
Issue Type: Bug
Affects Versions: 0.9.4
Reporter: peter royal
With the following snippet:
BufferedReader in = new BufferedReader(
new InputStreamReader( this.in ) );
String line;
while ( ( line = in.readLine() ) != null &&
!line.equals( "" ) )
{
System.out.println("data is:" + line);
}
After the data is printed, there is an exception
java.io.IOException: Stream is closed.
at
org.apache.mina.handler.support.IoSessionInputStream.waitForData(IoSessionInputStream.java:131)
at
org.apache.mina.handler.support.IoSessionInputStream.read(IoSessionInputStream.java:102)
at
sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
at
sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira