You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2006/07/17 01:53:14 UTC
[jira] Commented: (DIRMINA-226) IoSessionInputStream.read() does
not properly return -1 to indicate end-of-stream.
[ http://issues.apache.org/jira/browse/DIRMINA-226?page=comments#action_12421483 ]
Trustin Lee commented on DIRMINA-226:
-------------------------------------
The change looks good to me. Let's close this issue when you feel it is fixed tightly.
> 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
> Assigned To: peter royal
> Fix For: 0.9.5
>
>
> 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