f = new File(System.getProperty("user.dir"), "fd" + platformId + ".tst");
f.delete();
fos = new FileOutputStream(f.getPath());
fos.write("Test String".getBytes());
fis = new FileInputStream(f.getPath());
FileDescriptor fd = fos.getFD();
fd.sync();
int length = "Test String".length();
assertEquals("Bytes were not written after sync", length, fis
.available());
// Regression test for Harmony-1494
fd = fis.getFD();
fd.sync();
assertEquals("Bytes were not written after sync", length, fis
.available());
RandomAccessFile raf = new RandomAccessFile(f, "r");
fd = raf.getFD();
fd.sync();
raf.close();
}