Exemplo n.º 1
0
  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
  }
Exemplo n.º 2
0
 /** Returns the underlying file descriptor. */
 public final FileDescriptor getFD() throws IOException {
   return fis.getFD();
 }