summaryrefslogtreecommitdiff
path: root/java/nio/channels/Channels.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2005-01-12 10:08:13 +0000
committerMichael Koch <konqueror@gmx.de>2005-01-12 10:08:13 +0000
commita64804ad21e3984e7a599b26bde4b43aace4abd2 (patch)
tree9208932d13d2aa8fca6c290f37117e06f72a3ec5 /java/nio/channels/Channels.java
parent4f3c7ba555c9440667c7738da9ed43706eb40a4a (diff)
downloadclasspath-a64804ad21e3984e7a599b26bde4b43aace4abd2.tar.gz
2005-01-12 Michael Koch <konqueror@gmx.de>
* java/nio/channels/Channels.java (newInputStream(ReadableByteChannel)): Call VMChannels.newInputStream(ReadableByteChannel). (newOutputStream(WritableByteChannel): Call VMChannels.newOutputStream(WritableByteChannel). (newInputStream(FileChannelImpl)): Removed. (newOutputStream(FileChannelImpl)): Likewise. * vm/reference/java/nio/channels/VMChannels.java: Nw file. * native/jni/java-nio/Makefile.am: * native/jni/java-nio/java_nio_channels_Channels.c, include/java_nio_channels_Channels.h: Removed. * include/Makefile.am: Don't generate java_nio_channels_Channels.h. Removed java_nio_channels_Channels.c.
Diffstat (limited to 'java/nio/channels/Channels.java')
-rw-r--r--java/nio/channels/Channels.java25
1 files changed, 8 insertions, 17 deletions
diff --git a/java/nio/channels/Channels.java b/java/nio/channels/Channels.java
index 3e5316efb..7ac550f79 100644
--- a/java/nio/channels/Channels.java
+++ b/java/nio/channels/Channels.java
@@ -1,5 +1,5 @@
/* Channels.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,16 +35,12 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.nio.channels;
-import gnu.java.nio.ChannelInputStream;
-import gnu.java.nio.ChannelOutputStream;
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;
@@ -62,16 +58,17 @@ public final class Channels
/**
* This class isn't intended to be instantiated.
*/
- private Channels() {}
+ private Channels()
+ {
+ // Do nothing here.
+ }
/**
* Constructs a stream that reads bytes from the given channel.
*/
public static InputStream newInputStream(ReadableByteChannel ch)
{
- if (ch instanceof FileChannelImpl)
- return newInputStream((FileChannelImpl) ch);
- return new ChannelInputStream(ch);
+ return VMChannels.newInputStream(ch);
}
/**
@@ -79,15 +76,9 @@ public final class Channels
*/
public static OutputStream newOutputStream(WritableByteChannel ch)
{
- if (ch instanceof FileChannelImpl)
- return newOutputStream((FileChannelImpl) ch);
- return new ChannelOutputStream(ch);
+ return VMChannels.newOutputStream(ch);
}
- static native FileInputStream newInputStream(FileChannelImpl ch);
-
- static native FileOutputStream newOutputStream(FileChannelImpl ch);
-
/**
* Constructs a channel that reads bytes from the given stream.
*/