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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidforce(boolean metaData) final FileLocklock()abstract FileLocklock(long position, long size, boolean shared) abstract MappedByteBuffermap(FileChannel.MapMode mode, long position, long size) static FileChannelopen(Path path, OpenOption... options) abstract longposition()abstract FileChannelposition(long newPosition) abstract intread(ByteBuffer dst) final longread(ByteBuffer[] dsts) abstract longread(ByteBuffer[] dsts, int offset, int length) abstract intread(ByteBuffer dst, long position) abstract longsize()abstract longtransferFrom(ReadableByteChannel src, long position, long count) abstract longtransferTo(long position, long count, WritableByteChannel target) abstract FileChanneltruncate(long size) final FileLocktryLock()abstract FileLocktryLock(long position, long size, boolean shared) abstract intwrite(ByteBuffer src) final longwrite(ByteBuffer[] srcs) abstract longwrite(ByteBuffer[] srcs, int offset, int length) abstract intwrite(ByteBuffer src, long position) Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, implCloseChannel, isOpen
-
Constructor Details
-
FileChannel
protected FileChannel()
-
-
Method Details
-
open
- Throws:
IOException
-
read
- Specified by:
readin interfaceReadableByteChannel- Throws:
IOException
-
read
- Specified by:
readin interfaceScatteringByteChannel- Throws:
IOException
-
read
- Specified by:
readin interfaceScatteringByteChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceGatheringByteChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceGatheringByteChannel- Throws:
IOException
-
position
- Throws:
IOException
-
position
- Throws:
IOException
-
size
- Throws:
IOException
-
truncate
- Throws:
IOException
-
force
- 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
- Throws:
IOException
-
write
- Throws:
IOException
-
map
public abstract MappedByteBuffer map(FileChannel.MapMode mode, long position, long size) throws IOException - Throws:
IOException
-
lock
- Throws:
IOException
-
lock
- Throws:
IOException
-
tryLock
- Throws:
IOException
-
tryLock
- Throws:
IOException
-