-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
1.0
-
generic
-
generic
BufferedInputStream does not flush even when the program exits.
Test Program T1.java
----------------
import java.io.*;
class T1 {
public static void main(String argv[]){
BufferedOutputStream b;
String filename;
String outstr;
filename = "/tmp/b";
outstr = "Hello";
try {
b = new BufferedOutputStream (new FileOutputStream(filename));
for (int i =0; i<outstr.length(); i++) {
b.write(outstr.charAt(i));
}
} catch (IOException e) {
System.err.println("Exception");
System.exit(1);
}
}
}
$ javac T1.java
$ java T1
$ cat /tmp/b
$
Test Program T1.java
----------------
import java.io.*;
class T1 {
public static void main(String argv[]){
BufferedOutputStream b;
String filename;
String outstr;
filename = "/tmp/b";
outstr = "Hello";
try {
b = new BufferedOutputStream (new FileOutputStream(filename));
for (int i =0; i<outstr.length(); i++) {
b.write(outstr.charAt(i));
}
} catch (IOException e) {
System.err.println("Exception");
System.exit(1);
}
}
}
$ javac T1.java
$ java T1
$ cat /tmp/b
$