FileDescriptor: sync() : FileDescriptor « java.io « Java by API






FileDescriptor: sync()

 
import java.io.FileDescriptor;
import java.io.FileOutputStream;

public class Main {
  public static void main(String[] argv) throws Exception {
    FileOutputStream os = new FileOutputStream("outfilename");
    FileDescriptor fd = os.getFD();
    os.write(1);
    os.flush();
    fd.sync();
  }
}

   
  








Related examples in the same category