--- /home/cpdev/src/classpath/java/nio/channels/Channels.java	2005-07-02 21:03:37.000000000 +0000
+++ java/nio/channels/Channels.java	2005-06-30 05:34:41.000000000 +0000
@@ -38,10 +38,15 @@
 
 package java.nio.channels;
 
+import gnu.java.nio.ChannelInputStream;
+import gnu.java.nio.ChannelOutputStream;
 import gnu.java.nio.ChannelReader;
 import gnu.java.nio.InputStreamChannel;
 import gnu.java.nio.OutputStreamChannel;
+import gnu.java.nio.channels.FileChannelImpl;
 
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Reader;
@@ -69,7 +74,9 @@
    */
   public static InputStream newInputStream(ReadableByteChannel ch)
   {
-    return VMChannels.newInputStream(ch);
+    if (ch instanceof FileChannelImpl)
+      return newInputStream((FileChannelImpl) ch);
+    return new ChannelInputStream(ch);
   }
 
   /**
@@ -77,9 +84,15 @@
    */
   public static OutputStream newOutputStream(WritableByteChannel ch)
   {
-    return VMChannels.newOutputStream(ch);
+    if (ch instanceof FileChannelImpl)
+      return newOutputStream((FileChannelImpl) ch);
+    return new ChannelOutputStream(ch);
   }
 
+  static native FileInputStream newInputStream(FileChannelImpl ch);
+
+  static native FileOutputStream newOutputStream(FileChannelImpl ch);
+
   /**
    * Constructs a channel that reads bytes from the given stream.
    */
