package org.jacoco.core.runtime;

import java.io.IOException;
import java.io.InputStream;
import org.jacoco.core.data.ExecutionDataReader;
/* loaded from: classes7.dex */
public class RemoteControlReader extends ExecutionDataReader {
    private IRemoteCommandVisitor remoteCommandVisitor;

    public void setRemoteCommandVisitor(IRemoteCommandVisitor iRemoteCommandVisitor) {
        this.remoteCommandVisitor = iRemoteCommandVisitor;
    }

    public RemoteControlReader(InputStream inputStream) throws IOException {
        super(inputStream);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // org.jacoco.core.data.ExecutionDataReader
    public boolean readBlock(byte b) throws IOException {
        if (b != 32) {
            if (b == 64) {
                readDumpCommand();
                return true;
            }
            return super.readBlock(b);
        }
        return false;
    }

    private void readDumpCommand() throws IOException {
        if (this.remoteCommandVisitor == null) {
            throw new IOException("No remote command visitor.");
        }
        this.remoteCommandVisitor.visitDumpCommand(this.in.readBoolean(), this.in.readBoolean());
    }
}
