9e01bff779
* java/io/OutputStreamWriter.java (writeChars): Use a 'do' loop. Set 'out.count' earlier. (close): Call setFinished on converter. (flush): Always write work buffer. * java/io/PrintStream.java (writeChars): Do 'do' loop. (close): Call setFinished on converter. Write a 'flush' array. * java/lang/natString.cc (getBytes): Call setFinished on converter. * gnu/gcj/convert/CharsetToBytesAdaptor.java (hasBytes): New field. (write): Set hasBytes. Changed 'finished' logic. (havePendingBytes): Rewrote. (setFinished): New method. * gnu/gcj/convert/UnicodeToBytes.java (setFinished): New method. * testsuite/libjava.lang/RH194522.java: New file. * testsuite/libjava.lang/RH194522.out: New file. From-SVN: r115039
19 lines
473 B
Java
19 lines
473 B
Java
// Test case for http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=194522
|
|
|
|
import java.io.*;
|
|
import java.nio.charset.Charset;
|
|
|
|
public class RH194522
|
|
{
|
|
public static void main(String[] args) throws Exception
|
|
{
|
|
Charset c = Charset.forName("UTF-8");
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
PrintWriter pw = new PrintWriter(new OutputStreamWriter(baos, c));
|
|
pw.println("hi");
|
|
pw.println("bob");
|
|
pw.flush();
|
|
pw.close();
|
|
}
|
|
}
|