gnu/java/math/MPN.java \
gnu/java/nio/ByteBufferImpl.java \
gnu/java/nio/CharBufferImpl.java \
+gnu/java/nio/DatagramChannelImpl.java \
gnu/java/nio/DoubleBufferImpl.java \
+gnu/java/nio/FileChannelImpl.java \
gnu/java/nio/FloatBufferImpl.java \
gnu/java/nio/IntBufferImpl.java \
gnu/java/nio/LongBufferImpl.java \
+gnu/java/nio/PipeImpl.java \
+gnu/java/nio/SelectionKeyImpl.java \
+gnu/java/nio/SelectorImpl.java \
+gnu/java/nio/SelectorProviderImpl.java \
+gnu/java/nio/ServerSocketChannelImpl.java \
gnu/java/nio/ShortBufferImpl.java \
+gnu/java/nio/SocketChannelImpl.java \
gnu/java/nio/charset/ISO_8859_1.java \
gnu/java/nio/charset/Provider.java \
gnu/java/nio/charset/US_ASCII.java \
java/nio/channels/ConnectionPendingException.java \
java/nio/channels/DatagramChannel.java \
java/nio/channels/FileChannel.java \
+java/nio/channels/FileLock.java \
java/nio/channels/FileLockInterruptionException.java \
java/nio/channels/GatheringByteChannel.java \
java/nio/channels/IllegalBlockingModeException.java \
gnu/java/nio/natByteBufferImpl.cc \
gnu/java/nio/natCharBufferImpl.cc \
gnu/java/nio/natDoubleBufferImpl.cc \
+gnu/java/nio/natFileChannelImpl.cc \
gnu/java/nio/natFloatBufferImpl.cc \
gnu/java/nio/natIntBufferImpl.cc \
gnu/java/nio/natLongBufferImpl.cc \
+gnu/java/nio/natSelectorImpl.cc \
gnu/java/nio/natShortBufferImpl.cc \
+gnu/java/nio/natSocketChannelImpl.cc \
java/io/natFile.cc \
java/io/natFileDescriptor.cc \
java/io/natObjectInputStream.cc \
gnu/java/math/MPN.java \
gnu/java/nio/ByteBufferImpl.java \
gnu/java/nio/CharBufferImpl.java \
+gnu/java/nio/DatagramChannelImpl.java \
gnu/java/nio/DoubleBufferImpl.java \
+gnu/java/nio/FileChannelImpl.java \
gnu/java/nio/FloatBufferImpl.java \
gnu/java/nio/IntBufferImpl.java \
gnu/java/nio/LongBufferImpl.java \
+gnu/java/nio/PipeImpl.java \
+gnu/java/nio/SelectionKeyImpl.java \
+gnu/java/nio/SelectorImpl.java \
+gnu/java/nio/SelectorProviderImpl.java \
+gnu/java/nio/ServerSocketChannelImpl.java \
gnu/java/nio/ShortBufferImpl.java \
+gnu/java/nio/SocketChannelImpl.java \
gnu/java/nio/charset/ISO_8859_1.java \
gnu/java/nio/charset/Provider.java \
gnu/java/nio/charset/US_ASCII.java \
java/nio/channels/ConnectionPendingException.java \
java/nio/channels/DatagramChannel.java \
java/nio/channels/FileChannel.java \
+java/nio/channels/FileLock.java \
java/nio/channels/FileLockInterruptionException.java \
java/nio/channels/GatheringByteChannel.java \
java/nio/channels/IllegalBlockingModeException.java \
gnu/java/nio/natByteBufferImpl.cc \
gnu/java/nio/natCharBufferImpl.cc \
gnu/java/nio/natDoubleBufferImpl.cc \
+gnu/java/nio/natFileChannelImpl.cc \
gnu/java/nio/natFloatBufferImpl.cc \
gnu/java/nio/natIntBufferImpl.cc \
gnu/java/nio/natLongBufferImpl.cc \
+gnu/java/nio/natSelectorImpl.cc \
gnu/java/nio/natShortBufferImpl.cc \
+gnu/java/nio/natSocketChannelImpl.cc \
java/io/natFile.cc \
java/io/natFileDescriptor.cc \
java/io/natObjectInputStream.cc \
gnu/gcj/runtime/natStackTrace.lo gnu/gcj/runtime/natStringBuffer.lo \
gnu/gcj/runtime/natVMClassLoader.lo gnu/java/nio/natByteBufferImpl.lo \
gnu/java/nio/natCharBufferImpl.lo gnu/java/nio/natDoubleBufferImpl.lo \
+gnu/java/nio/natFileChannelImpl.lo \
gnu/java/nio/natFloatBufferImpl.lo gnu/java/nio/natIntBufferImpl.lo \
gnu/java/nio/natLongBufferImpl.lo \
-gnu/java/nio/natShortBufferImpl.lo \
+gnu/java/nio/natSelectorImpl.lo \
+gnu/java/nio/natShortBufferImpl.lo gnu/java/nio/natSocketChannelImpl.lo \
java/io/natFile.lo java/io/natFileDescriptor.lo \
java/io/natObjectInputStream.lo \
java/io/natObjectOutputStream.lo java/io/natVMObjectStreamClass.lo \
.deps/gnu/java/locale/LocaleInformation_zh_TW.P \
.deps/gnu/java/math/MPN.P .deps/gnu/java/nio/ByteBufferImpl.P \
.deps/gnu/java/nio/CharBufferImpl.P \
+.deps/gnu/java/nio/DatagramChannelImpl.P \
.deps/gnu/java/nio/DoubleBufferImpl.P \
+.deps/gnu/java/nio/FileChannelImpl.P \
.deps/gnu/java/nio/FloatBufferImpl.P .deps/gnu/java/nio/IntBufferImpl.P \
-.deps/gnu/java/nio/LongBufferImpl.P \
+.deps/gnu/java/nio/LongBufferImpl.P .deps/gnu/java/nio/PipeImpl.P \
+.deps/gnu/java/nio/SelectionKeyImpl.P .deps/gnu/java/nio/SelectorImpl.P \
+.deps/gnu/java/nio/SelectorProviderImpl.P \
+.deps/gnu/java/nio/ServerSocketChannelImpl.P \
.deps/gnu/java/nio/ShortBufferImpl.P \
+.deps/gnu/java/nio/SocketChannelImpl.P \
.deps/gnu/java/nio/charset/ISO_8859_1.P \
.deps/gnu/java/nio/charset/Provider.P \
.deps/gnu/java/nio/charset/US_ASCII.P \
.deps/gnu/java/nio/natByteBufferImpl.P \
.deps/gnu/java/nio/natCharBufferImpl.P \
.deps/gnu/java/nio/natDoubleBufferImpl.P \
+.deps/gnu/java/nio/natFileChannelImpl.P \
.deps/gnu/java/nio/natFloatBufferImpl.P \
.deps/gnu/java/nio/natIntBufferImpl.P \
.deps/gnu/java/nio/natLongBufferImpl.P \
+.deps/gnu/java/nio/natSelectorImpl.P \
.deps/gnu/java/nio/natShortBufferImpl.P \
+.deps/gnu/java/nio/natSocketChannelImpl.P \
.deps/gnu/java/rmi/RMIMarshalledObjectInputStream.P \
.deps/gnu/java/rmi/RMIMarshalledObjectOutputStream.P \
.deps/gnu/java/rmi/dgc/DGCImpl.P .deps/gnu/java/rmi/dgc/DGCImpl_Skel.P \
.deps/java/nio/channels/ConnectionPendingException.P \
.deps/java/nio/channels/DatagramChannel.P \
.deps/java/nio/channels/FileChannel.P \
+.deps/java/nio/channels/FileLock.P \
.deps/java/nio/channels/FileLockInterruptionException.P \
.deps/java/nio/channels/GatheringByteChannel.P \
.deps/java/nio/channels/IllegalBlockingModeException.P \
m = a;
}
+ /**
+ * Returns a string representation of the <code>MapMode</code> object.
+ */
public String toString()
{
- return "" + m;
+ if (this == READ_ONLY)
+ return "READ_ONLY";
+ else if (this == READ_WRITE)
+ return "READ_WRITE";
+
+ return "PRIVATE";
}
}
/**
* Maps the file into the memory.
*
- * @exception IOException If an error occurs.
+ * @exception IllegalArgumentException If the preconditions on the parameters
+ * do not hold.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonReadableChannelException If mode is READ_ONLY but this channel was
+ * not opened for reading.
+ * @exception NonWritableChannelException If mode is READ_WRITE or PRIVATE but this
+ * channel was not opened for writing.
*/
public abstract MappedByteBuffer map(MapMode mode, long position, long size)
throws IOException;
/**
* Return the size of the file thus far
+ *
+ * @exception ClosedChannelException If this channel is closed.
*/
public abstract long size() throws IOException;
/**
* Writes data to the channel.
*
- * @exception IOException If an error occurs.
+ * @exception IOException If an I/O error occurs.
*/
public long write (ByteBuffer[] srcs) throws IOException
{
/**
* Writes data to the channel.
+ *
+ * @exception IOException If an I/O error occurs.
+ */
+ public abstract int write (ByteBuffer src) throws IOException;
+
+ /**
+ * Writes data to the channel.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the transfer is in progress, thereby closing both
+ * channels and setting the current thread's interrupt status.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If position is negative.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonWritableChannelException If this channel was not opened for
+ * writing.
+ */
+ public abstract int write (ByteBuffer srcs, long position) throws IOException;
+
+ /**
+ * Writes data to the channel.
+ *
+ * @exception IOException If an I/O error occurs.
*/
public abstract long write(ByteBuffer[] srcs, int offset, int length)
throws IOException;
/**
* Reads data from the channel.
+ *
+ * @exception IOException If an I/O error occurs.
+ */
+ public abstract long read (ByteBuffer[] dsts, int offset, int length)
+ throws IOException;
+
+ /**
+ * Reads data from the channel.
+ *
+ * @exception IOException If an I/O error occurs.
+ */
+ public final long read (ByteBuffer[] dsts) throws IOException
+ {
+ long result = 0;
+
+ for (int i = 0; i < dsts.length; i++)
+ {
+ read (dsts [i]);
+ }
+
+ return result;
+ }
+
+ /**
+ * Reads data from the channel.
+ *
+ * @exception IOException If an I/O error occurs.
*/
public abstract int read(ByteBuffer dst) throws IOException;
+ /**
+ * Reads data from the channel.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the transfer is in progress, thereby closing both
+ * channels and setting the current thread's interrupt status.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If position is negative.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonReadableChannelException If this channel was not opened for
+ * reading.
+ */
+ public abstract int read(ByteBuffer dst, long position) throws IOException;
+
/**
* Closes the channel.
*
* This is called from @see close.
*
- * @exception IOException If an error occurs.
+ * @exception IOException If an I/O error occurs.
*/
protected abstract void implCloseChannel() throws IOException;
/**
* msync with the disk
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IOException If an I/O error occurs.
+ */
+ public abstract void force(boolean metaData) throws IOException;
+
+ /**
+ * Creates a file lock for the whole assoziated file.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception FileLockInterruptionException If the invoking thread is
+ * interrupted while blocked in this method.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonReadableChannelException If shared is true and this channel
+ * was not opened for reading.
+ * @exception NonWritableChannelException If shared is false and this channel
+ * was not opened for writing.
+ * @exception OverlappingFileLockException If a lock that overlaps the
+ * requested region is already held by this Java virtual machine, or if
+ * another thread is already blocked in this method and is attempting to lock
+ * an overlapping region.
+ */
+ public final FileLock lock () throws IOException
+ {
+ return lock (0, Long.MAX_VALUE, false);
+ }
+
+ /**
+ * Creates a file lock for a region of the assoziated file.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception FileLockInterruptionException If the invoking thread is
+ * interrupted while blocked in this method.
+ * @exception IllegalArgumentException If the preconditions on the parameters
+ * do not hold.
+ * @exception IOException If an I/O error occurs.
+ * @exception OverlappingFileLockException If a lock that overlaps the
+ * requested region is already held by this Java virtual machine, or if
+ * another thread is already blocked in this method and is attempting to lock
+ * an overlapping region.
+ * @exception NonReadableChannelException If shared is true and this channel
+ * was not opened for reading.
+ * @exception NonWritableChannelException If shared is false and this channel
+ * was not opened for writing.
+ */
+ public abstract FileLock lock (long position, long size, boolean shared)
+ throws IOException;
+
+ /**
+ * Tries to aqquire alock on the whole assoziated file.
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IOException If an I/O error occurs.
+ * @exception OverlappingFileLockException If a lock that overlaps the
+ * requested region is already held by this Java virtual machine, or if
+ * another thread is already blocked in this method and is attempting to lock
+ * an overlapping region.
+ */
+ public final FileLock tryLock () throws IOException
+ {
+ return tryLock (0, Long.MAX_VALUE, false);
+ }
+
+ /**
+ * Tries to aqquire a lock on a region of the assoziated file.
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If the preconditions on the parameters
+ * do not hold.
+ * @exception IOException If an I/O error occurs.
+ * @exception OverlappingFileLockException If a lock that overlaps the
+ * requested region is already held by this Java virtual machine, or if
+ * another thread is already blocked in this method and is attempting to lock
+ * an overlapping region.
+ */
+ public abstract FileLock tryLock (long position, long size, boolean shared)
+ throws IOException;
+
+ /**
+ * Returns the current position on the file.
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IOException If an I/O error occurs.
+ */
+ public abstract long position () throws IOException;
+
+ /**
+ * Sets the position of the channel on the assoziated file.
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If newPosition is negative.
+ * @exception IOException If an I/O error occurs.
+ */
+ public abstract FileChannel position (long newPosition) throws IOException;
+
+ /**
+ * Transfers bytes from this channel's file to the given writable byte
+ * channel.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the transfer is in progress, thereby closing both
+ * channels and setting the current thread's interrupt status.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If the preconditions on the parameters
+ * do not hold.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonReadableChannelException If this channel was not opened for
+ * reading.
+ * @exception NonWritableChannelException If the target channel was not
+ * opened for writing.
+ */
+ public abstract long transferTo (long position, long count,
+ WritableByteChannel target)
+ throws IOException;
+
+ /**
+ * Transfers bytes from the given readable channel into this channel.
+ *
+ * @exception AsynchronousCloseException If another thread closes this channel
+ * while the transfer is in progress.
+ * @exception ClosedByInterruptException If another thread interrupts the
+ * current thread while the transfer is in progress, thereby closing both
+ * channels and setting the current thread's interrupt status.
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If the preconditions on the parameters
+ * do not hold.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonReadableChannelException If the source channel was not
+ * opened for reading.
+ * @exception NonWritableChannelException If this channel was not opened for
+ * writing.
+ */
+ public abstract long transferFrom (ReadableByteChannel src, long position,
+ long count) throws IOException;
+
+ /**
+ * Truncates the channel's file at <code>size</code>.
+ *
+ * @exception ClosedChannelException If this channel is closed.
+ * @exception IllegalArgumentException If size is negative.
+ * @exception IOException If an I/O error occurs.
+ * @exception NonWritableChannelException If this channel was not opened for
+ * writing.
*/
- public abstract void force(boolean metaData);
+ public abstract FileChannel truncate (long size) throws IOException;
}