public static void main(String[] args) throws IOException { RandomAccessFile raf = new RandomAccessFile("classes/test/FileDescriptors.java", "r"); testDescriptorValidity(raf, raf.getFD()); FileInputStream fs1 = new FileInputStream("classes/test/FileDescriptors.java"); testDescriptorValidity(fs1, fs1.getFD()); File temp = File.createTempFile("Doppio-FileDescriptorsTest", ".txt"); FileOutputStream fs2 = new FileOutputStream(temp); testDescriptorValidity(fs2, fs2.getFD()); temp.delete(); // we don't support deleteOnExit either }
/** Returns the underlying file descriptor. */ public final FileDescriptor getFD() throws IOException { return fis.getFD(); }