summaryrefslogtreecommitdiffstats
path: root/libjava/java/nio/channels
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/nio/channels')
-rw-r--r--libjava/java/nio/channels/AlreadyConnectedException.java50
-rw-r--r--libjava/java/nio/channels/ByteChannel.java43
-rw-r--r--libjava/java/nio/channels/Channel.java55
-rw-r--r--libjava/java/nio/channels/ClosedChannelException.java50
-rw-r--r--libjava/java/nio/channels/GatheringByteChannel.java79
-rw-r--r--libjava/java/nio/channels/InterruptibleChannel.java50
-rw-r--r--libjava/java/nio/channels/ReadableByteChannel.java59
-rw-r--r--libjava/java/nio/channels/ScatteringByteChannel.java79
-rw-r--r--libjava/java/nio/channels/WritableByteChannel.java60
9 files changed, 525 insertions, 0 deletions
diff --git a/libjava/java/nio/channels/AlreadyConnectedException.java b/libjava/java/nio/channels/AlreadyConnectedException.java
new file mode 100644
index 00000000000..29e3cda0efa
--- /dev/null
+++ b/libjava/java/nio/channels/AlreadyConnectedException.java
@@ -0,0 +1,50 @@
+/* AlreadyConnectedException.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+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 java.io.IOException;
+
+public class AlreadyConnectedException extends IOException
+{
+ /**
+ * Creates the exception
+ */
+ public AlreadyConnectedException()
+ {
+ }
+}
diff --git a/libjava/java/nio/channels/ByteChannel.java b/libjava/java/nio/channels/ByteChannel.java
new file mode 100644
index 00000000000..f4958be2bf7
--- /dev/null
+++ b/libjava/java/nio/channels/ByteChannel.java
@@ -0,0 +1,43 @@
+/* ByteChannel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+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;
+
+public interface ByteChannel
+ extends ReadableByteChannel, WritableByteChannel
+{
+}
diff --git a/libjava/java/nio/channels/Channel.java b/libjava/java/nio/channels/Channel.java
new file mode 100644
index 00000000000..b5272c36776
--- /dev/null
+++ b/libjava/java/nio/channels/Channel.java
@@ -0,0 +1,55 @@
+/* Channel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+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 java.io.IOException;
+
+public interface Channel
+{
+ /**
+ * Tells whether this channel is open or not
+ */
+ public boolean isOpen();
+
+ /**
+ * Closes this channel
+ *
+ * @exception IOException If an error occurs
+ */
+ public void close() throws IOException;
+}
diff --git a/libjava/java/nio/channels/ClosedChannelException.java b/libjava/java/nio/channels/ClosedChannelException.java
new file mode 100644
index 00000000000..2576d34c3c8
--- /dev/null
+++ b/libjava/java/nio/channels/ClosedChannelException.java
@@ -0,0 +1,50 @@
+/* ClosedChannelException.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+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 java.io.IOException;
+
+public class ClosedChannelException extends IOException
+{
+ /**
+ * Creates the exception
+ */
+ public ClosedChannelException()
+ {
+ }
+}
diff --git a/libjava/java/nio/channels/GatheringByteChannel.java b/libjava/java/nio/channels/GatheringByteChannel.java
new file mode 100644
index 00000000000..3ef12b7b6dc
--- /dev/null
+++ b/libjava/java/nio/channels/GatheringByteChannel.java
@@ -0,0 +1,79 @@
+/* GatheringByteChannel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+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 java.nio.ByteBuffer;
+import java.io.IOException;
+
+public interface GatheringByteChannel
+ extends WritableByteChannel
+{
+ /**
+ * Writes a sequence of bytes to this channel from a subsequence of
+ * the given buffers
+ *
+ * @exception AsynchronousCloseException If another thread closes this
+ * channel while the write operation is in progress
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the write operation is in progress, thereby closing
+ * the channel and setting the current thread's interrupt status
+ * @exception ClosedChannelException If this channel is closed
+ * @exception IndexOutOfBoundsException If the preconditions on the offset
+ * and length parameters do not hold
+ * @exception IOException If an error occurs
+ * @exception NonWritableChannelException If this channel was not opened for
+ * writing
+ */
+ public long write(ByteBuffer[] srcs, int offset, int length)
+ throws IOException;
+
+ /**
+ * Writes a sequence of bytes to this channel from the given buffers
+ *
+ * @exception AsynchronousCloseException If another thread closes this
+ * channel while the write operation is in progress
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the write operation is in progress, thereby closing
+ * the channel and setting the current thread's interrupt status
+ * @exception ClosedChannelException If this channel is closed
+ * @exception IOException If an error occurs
+ * @exception NonWritableChannelException If this channel was not opened for
+ * writing
+ */
+ public long write(ByteBuffer[] srcs) throws IOException;
+}
diff --git a/libjava/java/nio/channels/InterruptibleChannel.java b/libjava/java/nio/channels/InterruptibleChannel.java
new file mode 100644
index 00000000000..0b55e7619a5
--- /dev/null
+++ b/libjava/java/nio/channels/InterruptibleChannel.java
@@ -0,0 +1,50 @@
+/* InterruptibleChannel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+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 java.io.IOException;
+
+public interface InterruptibleChannel extends Channel
+{
+ /**
+ * Closes this channel
+ *
+ * @exception IOException If an error occurs
+ */
+ void close() throws IOException;
+}
diff --git a/libjava/java/nio/channels/ReadableByteChannel.java b/libjava/java/nio/channels/ReadableByteChannel.java
new file mode 100644
index 00000000000..d1653cc8d3e
--- /dev/null
+++ b/libjava/java/nio/channels/ReadableByteChannel.java
@@ -0,0 +1,59 @@
+/* ReadableByteChannel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+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 java.io.IOException;
+import java.nio.ByteBuffer;
+
+public interface ReadableByteChannel extends Channel
+{
+ /**
+ * Reads a sequence of bytes from this channel into the given buffer
+ *
+ * @exception AsynchronousCloseException If another thread closes this
+ * channel while the read operation is in progress
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the read operation is in progress, thereby closing
+ * the channel and setting the current thread's interrupt status
+ * @exception ClosedChannelException If this channel is closed
+ * @exception IOException If an error occurs
+ * @exception NonReadableChannelException If this channel was not opened for
+ * reading
+ */
+ public int read (ByteBuffer dst) throws IOException;
+}
diff --git a/libjava/java/nio/channels/ScatteringByteChannel.java b/libjava/java/nio/channels/ScatteringByteChannel.java
new file mode 100644
index 00000000000..a9efdbef448
--- /dev/null
+++ b/libjava/java/nio/channels/ScatteringByteChannel.java
@@ -0,0 +1,79 @@
+/* ScatteringByteChannel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+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 java.nio.ByteBuffer;
+import java.io.IOException;
+
+public interface ScatteringByteChannel
+ extends ReadableByteChannel
+{
+ /**
+ * Reads a sequence of bytes from this channel into a subsequence of the
+ * given buffers
+ *
+ * @exception AsynchronousCloseException If another thread closes this
+ * channel while the write operation is in progress
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the write operation is in progress, thereby closing
+ * the channel and setting the current thread's interrupt status
+ * @exception ClosedChannelException If this channel is closed
+ * @exception IndexOutOfBoundsException If the preconditions on the offset
+ * and length parameters do not hold
+ * @exception IOException If an error occurs
+ * @exception NonReadableChannelException If this channel was not opened for
+ * reading
+ */
+ public long read(ByteBuffer[] srcs, int offset, int length)
+ throws IOException;
+
+ /**
+ * Reads a sequence of bytes from this channel into the given buffers
+ *
+ * @exception AsynchronousCloseException If another thread closes this
+ * channel while the write operation is in progress
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the write operation is in progress, thereby closing
+ * the channel and setting the current thread's interrupt status
+ * @exception ClosedChannelException If this channel is closed
+ * @exception IOException If an error occurs
+ * @exception NonReadableChannelException If this channel was not opened for
+ * reading
+ */
+ public long read(ByteBuffer[] srcs) throws IOException;
+}
diff --git a/libjava/java/nio/channels/WritableByteChannel.java b/libjava/java/nio/channels/WritableByteChannel.java
new file mode 100644
index 00000000000..003437e5f3c
--- /dev/null
+++ b/libjava/java/nio/channels/WritableByteChannel.java
@@ -0,0 +1,60 @@
+/* WritableByteChannel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+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 java.io.IOException;
+import java.nio.ByteBuffer;
+
+public interface WritableByteChannel
+ extends Channel
+{
+ /**
+ * Writes a sequence of bytes to this channel from the given buffer
+ *
+ * @exception AsynchronousCloseException If another thread closes this
+ * channel while the write operation is in progress
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the write operation is in progress, thereby closing
+ * the channel and setting the current thread's interrupt status
+ * @exception ClosedChannelException If this channel is closed
+ * @exception IOException If an error occurs
+ * @exception NonWritableChannelException If this channel was not opened for
+ * writing
+ */
+ public int write(ByteBuffer src) throws IOException;
+}
OpenPOWER on IntegriCloud