package androidx.media3.exoplayer.source.mediaparser; import android.media.MediaParser; import androidx.media3.common.DataReader; import androidx.media3.common.util.Util; import java.io.IOException; /* loaded from: classes2.dex */ public final class InputReaderAdapterV30 implements MediaParser.SeekableInputReader { private long currentPosition; private DataReader dataReader; private long lastSeekPosition; private long resourceLength; public long getAndResetSeekPosition() { long j = this.lastSeekPosition; this.lastSeekPosition = -1L; return j; } @Override // android.media.MediaParser.InputReader public long getLength() { return this.resourceLength; } @Override // android.media.MediaParser.InputReader public long getPosition() { return this.currentPosition; } @Override // android.media.MediaParser.SeekableInputReader public void seekToPosition(long j) { this.lastSeekPosition = j; } public void setCurrentPosition(long j) { this.currentPosition = j; } public void setDataReader(DataReader dataReader, long j) { this.dataReader = dataReader; this.resourceLength = j; this.lastSeekPosition = -1L; } @Override // android.media.MediaParser.InputReader public int read(byte[] bArr, int i, int i2) throws IOException { int read = ((DataReader) Util.castNonNull(this.dataReader)).read(bArr, i, i2); this.currentPosition += read; return read; } }