title: Java NIO and Windows disk access
body: <p>Does Java NIO need special permissions on Windows?</p>
  
  <p>When I run the following Java code on Windows Server 2003, it fails with an "access denied" error (that's the whole message in the cygwin terminal window):</p>
  
  <pre><code>new FileOutputStream(outputFile).getChannel()
    .transferFrom(new FileInputStream(inputFile).getChannel(), 0, Long.MAX_VALUE);
  </code></pre>
  
  <p>but if I use Apache commons-io (which I assume does NOT use NIO, it works with the same input and output files:</p>
  
  <pre><code>final FileInputStream inputStream = new FileInputStream(inputFile)
  final FileOutputStream outputStream = new FileOutputStream(outputStream)
  IOUtils.copy(inputStream, outputStream);
  </code></pre>
  
  <p>I am running in Java 5 with an administrator account. Is there some special file permission that must set?</p>