This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
output stream bug
- To: java-discuss@sourceware.cygnus.com
- Subject: output stream bug
- From: jmc@cmpharm.ucsf.edu
- Date: Tue, 15 Jun 1999 17:29:37 -0700 (PDT)
Hi,
There seems to be a bug when mixing write(byte) and write(byte[])
calls to output streams. In a JVM, the following code writes
"XoooXooo" like it should; in gcj compiled output, it writes
"ooooooXX". I'm using the 6/8/99 snapshots of egcs and libgcj,
compiled with --enable-fast-character --enable-threads=posix, on
a linux 2.2.10 box.
import java.io.*;
public class TestStreams {
final public static byte[] ooo =
new String("ooo").getBytes();
final public static void main(String[] argv) {
try {
System.out.write('X');
System.out.write(ooo);
System.out.write('X');
System.out.write(ooo);
System.out.flush();
}
catch (IOException e) {
System.out.println("This doesn't happen.");
}
}
}
I still haven't succeeded in compiling libgcj on a SGI, due to bugs
discussed earlier on this list, so I don't know if this happens
on other systems.
Thanks,
JMC
--
John-Marc Chandonia (jmc@cmpharm.ucsf.edu) We're everywhere...
Cohen Lab, University of California San Francisco for your convenience.
http://yuri.harvard.edu/~jmc -- Psi Corps <*>