Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1244595

BufferedInputStream does not flush even when the program exits

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      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
      $

        Attachments

          Activity

            People

            Assignee:
            mr Mark Reinhold
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: