Package java.nio.channels

# Class FileChannel

java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.FileChannel

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

public abstract class FileChannel extends AbstractInterruptibleChannel implements GatheringByteChannel, ScatteringByteChannel
Compatibility stub.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`FileChannel.MapMode`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`FileChannel()`

## Method Summary

Modifier and Type
Method
Description
`abstract void`
`force(boolean metaData)`
`final FileLock`
`lock()`
`abstract FileLock`
`lock(long position, long size, boolean shared)`
`abstract MappedByteBuffer`
`map(FileChannel.MapMode mode, long position, long size)`
`static FileChannel`
`open(Path path, OpenOption... options)`
`abstract long`
`position()`
`abstract FileChannel`
`position(long newPosition)`
`abstract int`
`read(ByteBuffer dst)`
`final long`
`read(ByteBuffer[] dsts)`
`abstract long`
`read(ByteBuffer[] dsts, int offset, int length)`
`abstract int`
`read(ByteBuffer dst, long position)`
`abstract long`
`size()`
`abstract long`
`transferFrom(ReadableByteChannel src, long position, long count)`
`abstract long`
`transferTo(long position, long count, WritableByteChannel target)`
`abstract FileChannel`
`truncate(long size)`
`final FileLock`
`tryLock()`
`abstract FileLock`
`tryLock(long position, long size, boolean shared)`
`abstract int`
`write(ByteBuffer src)`
`final long`
`write(ByteBuffer[] srcs)`
`abstract long`
`write(ByteBuffer[] srcs, int offset, int length)`
`abstract int`
`write(ByteBuffer src, long position)`

### Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel

`begin, close, end, implCloseChannel, isOpen`

### Methods inherited from class java.lang.Object

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

### Methods inherited from interface java.nio.channels.Channel

`isOpen`

## Constructor Details

### FileChannel

protected FileChannel()

## Method Details

### open

public static FileChannel open(Path path, OpenOption... options) throws IOException

Throws:
  `IOException`

### read

public abstract int read(ByteBuffer dst) throws IOException

Specified by:
  `read` in interface `ReadableByteChannel`
Throws:
  `IOException`

### read

public abstract long read(ByteBuffer[] dsts, int offset, int length) throws IOException

Specified by:
  `read` in interface `ScatteringByteChannel`
Throws:
  `IOException`

### read

public final long read(ByteBuffer[] dsts) throws IOException

Specified by:
  `read` in interface `ScatteringByteChannel`
Throws:
  `IOException`

### write

public abstract int write(ByteBuffer src) throws IOException

Specified by:
  `write` in interface `WritableByteChannel`
Throws:
  `IOException`

### write

public abstract long write(ByteBuffer[] srcs, int offset, int length) throws IOException

Specified by:
  `write` in interface `GatheringByteChannel`
Throws:
  `IOException`

### write

public final long write(ByteBuffer[] srcs) throws IOException

Specified by:
  `write` in interface `GatheringByteChannel`
Throws:
  `IOException`

### position

public abstract long position() throws IOException

Throws:
  `IOException`

### position

public abstract FileChannel position(long newPosition) throws IOException

Throws:
  `IOException`

### size

public abstract long size() throws IOException

Throws:
  `IOException`

### truncate

public abstract FileChannel truncate(long size) throws IOException

Throws:
  `IOException`

### force

public abstract void force(boolean metaData) throws IOException

Throws:
  `IOException`

### transferTo

public abstract long transferTo(long position, long count, WritableByteChannel target) throws IOException

Throws:
  `IOException`

### transferFrom

public abstract long transferFrom(ReadableByteChannel src, long position, long count) throws IOException

Throws:
  `IOException`

### read

public abstract int read(ByteBuffer dst, long position) throws IOException

Throws:
  `IOException`

### write

public abstract int write(ByteBuffer src, long position) throws IOException

Throws:
  `IOException`

### map

public abstract MappedByteBuffer map(FileChannel.MapMode mode, long position, long size) throws IOException

Throws:
  `IOException`

### lock

public abstract FileLock lock(long position, long size, boolean shared) throws IOException

Throws:
  `IOException`

### lock

public final FileLock lock() throws IOException

Throws:
  `IOException`

### tryLock

public abstract FileLock tryLock(long position, long size, boolean shared) throws IOException

Throws:
  `IOException`

### tryLock

public final FileLock tryLock() throws IOException

Throws:
  `IOException`