title: Using a numbered file descriptor from Java
body: <p>I need to access numbered file descriptors from Java -- other than 0, 1 or 2.</p>
  <p>How can this be done?  I looked at the <code>FileDescriptor</code> class but did'nt find any way to initialize it with a given file descriptor number.</p>
  <p>As a concrete example lets suppose Java gets called as a child process from another programing language.  File descriptors 3 and 4 are provided by the other language for input and output.</p>
  <p>What I need in Java are <code>InputStream</code> and <code>OutputStream</code> objects connected to these file-descriptors, just like System.in, System.out and System.error are connected to file-desctiptors 0, 1 and 2.</p>
  <p>I'm using Java 1.6 and this should run on Unix alike systems.</p>