p.java 源代码


package v5;

import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;

public class p extends InputStream {

    private int f27218q;

    private final RandomAccessFile f27219r;

    public p(RandomAccessFile randomAccessFile, int i6) {
        this.f27218q = i6;
        this.f27219r = randomAccessFile;
    }

    @Override
    public int available() throws IOException {
        return ((int) this.f27219r.length()) - this.f27218q;
    }

    @Override
    public boolean markSupported() {
        return false;
    }

    @Override
    public int read() throws IOException {
        this.f27219r.seek(this.f27218q);
        this.f27218q++;
        return this.f27219r.read();
    }

    @Override
    public long skip(long j6) throws IOException {
        int min = Math.min((int) j6, available());
        this.f27218q += min;
        return min;
    }

    @Override
    public int read(byte[] bArr) throws IOException {
        this.f27219r.seek(this.f27218q);
        int read = this.f27219r.read(bArr);
        this.f27218q += read;
        return read;
    }

    @Override
    public int read(byte[] bArr, int i6, int i7) throws IOException {
        this.f27219r.seek(this.f27218q);
        int read = this.f27219r.read(bArr, i6, i7);
        this.f27218q += read;
        return read;
    }
}