Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.nio.channels

Class FileChannel

java.lang.Object
|
+--java.nio.channels.spi.AbstractInterruptibleChannel
   |
   +--java.nio.channels.FileChannel

All Implemented Interfaces:

ByteChannel, GatheringByteChannel, ScatteringByteChannel, Channel, InterruptibleChannel


public abstract class FileChannel

extends AbstractInterruptibleChannel

implements ByteChannel, GatheringByteChannel, ScatteringByteChannel

Since:Author:

Constructor Summary

FileChannel()

Initializes the channel.

Method Summary

voidforce(boolean metaData)

msync with the disk
voidimplCloseChannel()

Closes the channel.
java.nio.MappedByteBuffermap(java.nio.channels.FileChannel.MapMode mode, long position, long size)

Maps the file into the memory.
longread(java.nio.ByteBuffer[] dsts)

intread(java.nio.ByteBuffer dst)

Reads data from the channel.
longsize()

Return the size of the file thus far
longwrite(java.nio.ByteBuffer[] srcs)

Writes data to the channel.
intwrite(java.nio.ByteBuffer src)

longwrite(java.nio.ByteBuffer[] srcs, int offset, int length)

Writes data to the channel.

Constructor Details

FileChannel

protected FileChannel()

Initializes the channel.


Method Details

force

public void force(boolean metaData)

msync with the disk

Parameters:


implCloseChannel

protected void implCloseChannel()

Closes the channel. This is called from @see close.

Throws:


map

public MappedByteBuffer map(java.nio.channels.FileChannel.MapMode mode, long position, long size)

Maps the file into the memory.

Parameters:

Throws:


read

public final long read(java.nio.ByteBuffer[] dsts)

Parameters:


read

public int read(java.nio.ByteBuffer dst)

Reads data from the channel.

Parameters:


size

public long size()

Return the size of the file thus far


write

public long write(java.nio.ByteBuffer[] srcs)

Writes data to the channel.

Parameters:

Throws:


write

public int write(java.nio.ByteBuffer src)

Parameters:


write

public long write(java.nio.ByteBuffer[] srcs, int offset, int length)

Writes data to the channel.

Parameters: