public class ReadOnlyFileChannel extends FileChannel
Implementation note: this class is optimized for use with Database.
Therefore not all methods may be implemented.
FileChannel.MapMode| Constructor and Description |
|---|
ReadOnlyFileChannel(FileChannel delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
force(boolean metaData) |
FileLock |
lock(long position,
long size,
boolean shared) |
MappedByteBuffer |
map(FileChannel.MapMode mode,
long position,
long size) |
long |
position() |
FileChannel |
position(long newPosition) |
int |
read(ByteBuffer dst) |
long |
read(ByteBuffer[] dsts,
int offset,
int length) |
int |
read(ByteBuffer dst,
long position) |
long |
size() |
long |
transferFrom(ReadableByteChannel src,
long position,
long count) |
long |
transferTo(long position,
long count,
WritableByteChannel target) |
FileChannel |
truncate(long size) |
FileLock |
tryLock(long position,
long size,
boolean shared) |
int |
write(ByteBuffer src) |
long |
write(ByteBuffer[] srcs,
int offset,
int length) |
int |
write(ByteBuffer src,
long position) |
close, isOpenpublic ReadOnlyFileChannel(FileChannel delegate)
public int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelread in interface SeekableByteChannelread in class FileChannelIOExceptionpublic long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read in interface ScatteringByteChannelread in class FileChannelIOExceptionpublic int read(ByteBuffer dst, long position) throws IOException
read in class FileChannelIOExceptionpublic long position()
throws IOException
position in interface SeekableByteChannelposition in class FileChannelIOExceptionpublic FileChannel position(long newPosition) throws IOException
position in interface SeekableByteChannelposition in class FileChannelIOExceptionpublic long size()
throws IOException
size in interface SeekableByteChannelsize in class FileChannelIOExceptionpublic FileChannel truncate(long size)
truncate in interface SeekableByteChanneltruncate in class FileChannelpublic void force(boolean metaData)
force in class FileChannelpublic long transferTo(long position,
long count,
WritableByteChannel target)
throws IOException
transferTo in class FileChannelIOExceptionpublic long transferFrom(ReadableByteChannel src, long position, long count)
transferFrom in class FileChannelpublic int write(ByteBuffer src, long position)
write in class FileChannelpublic int write(ByteBuffer src)
write in interface SeekableByteChannelwrite in interface WritableByteChannelwrite in class FileChannelpublic long write(ByteBuffer[] srcs, int offset, int length)
write in interface GatheringByteChannelwrite in class FileChannelpublic MappedByteBuffer map(FileChannel.MapMode mode, long position, long size)
map in class FileChannelpublic FileLock lock(long position, long size, boolean shared)
lock in class FileChannelpublic FileLock tryLock(long position, long size, boolean shared)
tryLock in class FileChannelCopyright © 2005–2025 OpenHMS. All rights reserved.