When 8K of data is requested gcj returns only 2K (Sun's VM returns full 8K). example code: import java.io.*; public class BufferedReaderReadTest { public static void main( String [] args ) throws Exception { char [] b = new char[ 8 * 1024 ]; BufferedReader in = new BufferedReader( new FileReader( args [0] ), 8 * 1024 ); System.out.println( "read() = " + in.read( b, 0, b.length ) ); in.close(); } }
Note BufferedReader does not need to read in the full buffer, it actually is a non blocking reader: From <http://java.sun.com/j2se/1.4.2/docs/api/java/io/ BufferedReader.html#read(char[],%20int,%20int)> The ready method of the underlying stream returns false, indicating that further input requests would block. so I don't know if this is a real bug or not.
*** This bug has been marked as a duplicate of 18376 ***