All Implemented Interfaces:
Closeable, AutoCloseable, ByteChannel, Channel, GatheringByteChannel, InterruptibleChannel, ReadableByteChannel, ScatteringByteChannel, SeekableByteChannel, WritableByteChannel

  • Nested Class Summary

    Nested Classes

  • Constructor Summary

    Constructors

    protected

    Initializes a new instance of this class.

  • Method Summary

    abstract void

    force(boolean metaData)

    Forces any updates to this channel's file to be written to the storage device that contains it.

    lock()

    Acquires an exclusive lock on this channel's file.

    lock(long position, long size, boolean shared)

    Acquires a lock on the given region of this channel's file.

    Maps a region of this channel's file directly into memory.

    Maps a region of this channel's file into a new mapped memory segment, with the given offset, size and arena.

    Opens or creates a file, returning a file channel to access the file.

    Opens or creates a file, returning a file channel to access the file.

    abstract long

    position()

    Returns this channel's file position.

    position(long newPosition)

    Sets this channel's file position.

    abstract int

    Reads a sequence of bytes from this channel into the given buffer.

    final long

    Reads a sequence of bytes from this channel into the given buffers.

    abstract long

    read(ByteBuffer[] dsts, int offset, int length)

    Reads a sequence of bytes from this channel into a subsequence of the given buffers.

    abstract int

    Reads a sequence of bytes from this channel into the given buffer, starting at the given file position.

    abstract long

    size()

    Returns the current size of this channel's file.

    abstract long

    Transfers bytes into this channel's file from the given readable byte channel.

    abstract long

    Transfers bytes from this channel's file to the given writable byte channel.

    truncate(long size)

    Truncates this channel's file to the given size.

    tryLock()

    Attempts to acquire an exclusive lock on this channel's file.

    tryLock(long position, long size, boolean shared)

    Attempts to acquire a lock on the given region of this channel's file.

    abstract int

    Writes a sequence of bytes to this channel from the given buffer.

    final long

    Writes a sequence of bytes to this channel from the given buffers.

    abstract long

    write(ByteBuffer[] srcs, int offset, int length)

    Writes a sequence of bytes to this channel from a subsequence of the given buffers.

    abstract int

    Writes a sequence of bytes to this channel from the given buffer, starting at the given file position.

    Methods declared in class AbstractInterruptibleChannel

    begin, close, end, implCloseChannel, isOpen

    protected final void

    Marks the beginning of an I/O operation that might block indefinitely.

    final void

    protected final void

    end(boolean completed)

    Marks the end of an I/O operation that might block indefinitely.

    protected abstract void

    final boolean

    Tells whether or not this channel is open.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Creates and returns a copy of this object.

    boolean

    Indicates whether some other object is "equal to" this one.

    protected void

    Deprecated, for removal: This API element is subject to removal in a future version.

    Returns the runtime class of this Object.

    int

    Returns a hash code value for this object.

    final void

    Wakes up a single thread that is waiting on this object's monitor.

    final void

    Wakes up all threads that are waiting on this object's monitor.

    Returns a string representation of the object.

    final void

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

    final void

    wait(long timeoutMillis)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    final void

    wait(long timeoutMillis, int nanos)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

  • Constructor Details

    • FileChannel

  • Method Details

    • open

    • open

    • read

    • read

    • read

    • write

    • write

    • write

    • position

    • position

    • size

    • truncate

    • force

    • transferTo

    • transferFrom

    • read

    • write

    • map

    • map

    • lock

    • lock

    • tryLock

    • tryLock