class FileDisk extends FileBase {

    private final RandomAccessFile file;
    private final String name;
    private final boolean readOnly;

    FileDisk(String fileName, String mode) throws FileNotFoundException {
        this.file = new RandomAccessFile(fileName, mode);
        this.name = fileName;
        this.readOnly = mode.equals("r");
    }

    @Override
    public void force(boolean metaData) throws IOException {
        String m = SysProperties.SYNC_METHOD;
        if ("".equals(m)) {
            // do nothing
        } else if ("sync".equals(m)) {
            file.getFD().sync();
        } else if ("force".equals(m)) {
            file.getChannel().force(true);
        } else if ("forceFalse".equals(m)) {
            file.getChannel().force(false);
        } else {
            file.getFD().sync();
        }
    }

    @Override
    public FileChannel truncate(long newLength) throws IOException {
        // compatibility with JDK FileChannel#truncate
        if (readOnly) {
            throw new NonWritableChannelException();
        }
        if (newLength < file.length()) {
            file.setLength(newLength);
        }
        return this;
    }

    @Override
    public synchronized FileLock tryLock(long position, long size, boolean shared) throws IOException {
        return file.getChannel().tryLock(position, size, shared);
    }

    @Override
    public void implCloseChannel() throws IOException {
        file.close();
    }

    @Override
    public long position() throws IOException {
        return file.getFilePointer();
    }

    @Override
    public long size() throws IOException {
        return file.length();
    }

    @Override
    public int read(ByteBuffer dst) throws IOException {<FILL_FUNCTION_BODY>}

    @Override
    public FileChannel position(long pos) throws IOException {
        file.seek(pos);
        return this;
    }

    @Override
    public int write(ByteBuffer src) throws IOException {
        int len = src.remaining();
        file.write(src.array(), src.arrayOffset() + src.position(), len);
        src.position(src.position() + len);
        return len;
    }

    @Override
    public String toString() {
        return name;
    }
}

        int len = file.read(dst.array(), dst.arrayOffset() + dst.position(), dst.remaining());
        if (len > 0) {
            dst.position(dst.position() + len);
        }
        return len;
    
<methods>public non-sealed void <init>() ,public void force(boolean) throws java.io.IOException,public java.nio.channels.FileLock lock(long, long, boolean) throws java.io.IOException,public java.nio.MappedByteBuffer map(java.nio.channels.FileChannel.MapMode, long, long) throws java.io.IOException,public abstract long position() throws java.io.IOException,public abstract java.nio.channels.FileChannel position(long) throws java.io.IOException,public abstract int read(java.nio.ByteBuffer) throws java.io.IOException,public synchronized int read(java.nio.ByteBuffer, long) throws java.io.IOException,public long read(java.nio.ByteBuffer[], int, int) throws java.io.IOException,public abstract long size() throws java.io.IOException,public long transferFrom(java.nio.channels.ReadableByteChannel, long, long) throws java.io.IOException,public long transferTo(long, long, java.nio.channels.WritableByteChannel) throws java.io.IOException,public abstract java.nio.channels.FileChannel truncate(long) throws java.io.IOException,public java.nio.channels.FileLock tryLock(long, long, boolean) throws java.io.IOException,public abstract int write(java.nio.ByteBuffer) throws java.io.IOException,public synchronized int write(java.nio.ByteBuffer, long) throws java.io.IOException,public long write(java.nio.ByteBuffer[], int, int) throws java.io.IOException<variables>