Community
Participate
Working Groups
1. Run the following program public class ConsoleTest { public static void main(String[] args) { try { byte[] b = new byte[100]; for(;;) { int read = System.in.read(b); System.out.write(b, 0, read); } } catch (Exception e) { e.printStackTrace(); } } } 2. Enter '123' in the console 3. replace '2' with 'x' 4. hit 'enter' console output is 13x instead of 1x3.
IOConsolePartitioner incorrectly assumed user input was always at the end of the document. Fixed in IOConsolePartitioner and IOConsolePartition.
DarinS, please verify
I changed the method name to insert and to use StringBuffer.insert(int, String) instead of replace. Makes the code more clear to me. Verified.