Java java.nio.channels FileChannel fields, constructors, methods, implement or subclass

Example usage for Java java.nio.channels FileChannel fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.nio.channels FileChannel.

The text is from its open source code.

Method

voidclose()
Closes this channel.
voidforce(boolean metaData)
Forces any updates to this channel's file to be written to the storage device that contains it.
booleanisOpen()
FileLocklock()
Acquires an exclusive lock on this channel's file.
FileLocklock(long position, long size, boolean shared)
Acquires a lock on the given region of this channel's file.
MappedByteBuffermap(MapMode mode, long position, long size)
Maps a region of this channel's file directly into memory.
FileChannelopen(Path path, Set options, FileAttribute... attrs)
Opens or creates a file, returning a file channel to access the file.
FileChannelopen(Path path, OpenOption... options)
Opens or creates a file, returning a file channel to access the file.
FileChannelposition(long newPosition)
Sets this channel's file position.
longposition()
Returns this channel's file position.
intread(ByteBuffer dst)
Reads a sequence of bytes from this channel into the given buffer.
longread(ByteBuffer[] dsts)
Reads a sequence of bytes from this channel into the given buffers.
intread(ByteBuffer dst, long position)
Reads a sequence of bytes from this channel into the given buffer, starting at the given file position.
longsize()
Returns the current size of this channel's file.
StringtoString()
Returns a string representation of the object.
longtransferFrom(ReadableByteChannel src, long position, long count)
Transfers bytes into this channel's file from the given readable byte channel.
longtransferTo(long position, long count, WritableByteChannel target)
Transfers bytes from this channel's file to the given writable byte channel.
FileChanneltruncate(long size)
Truncates this channel's file to the given size.
FileLocktryLock()
Attempts to acquire an exclusive lock on this channel's file.
FileLocktryLock(long position, long size, boolean shared)
Attempts to acquire a lock on the given region of this channel's file.
intwrite(ByteBuffer src)
Writes a sequence of bytes to this channel from the given buffer.
longwrite(ByteBuffer[] srcs)
Writes a sequence of bytes to this channel from the given buffers.
intwrite(ByteBuffer src, long position)
Writes a sequence of bytes to this channel from the given buffer, starting at the given file position.