Files
rr3-apk/decompiled-community/sources/com/mbridge/msdk/playercommon/exoplayer2/upstream/DataSourceInputStream.java
Daniel Elliott c080f0d97f Add Discord community version (64-bit only)
- Added realracing3-community.apk (71.57 MB)
- Removed 32-bit support (armeabi-v7a)
- Only includes arm64-v8a libraries
- Decompiled source code included
- Added README-community.md with analysis
2026-02-18 15:48:36 -08:00

72 lines
2.0 KiB
Java

package com.mbridge.msdk.playercommon.exoplayer2.upstream;
import androidx.annotation.NonNull;
import com.mbridge.msdk.playercommon.exoplayer2.util.Assertions;
import java.io.IOException;
import java.io.InputStream;
/* loaded from: classes4.dex */
public final class DataSourceInputStream extends InputStream {
private final DataSource dataSource;
private final DataSpec dataSpec;
private long totalBytesRead;
private boolean opened = false;
private boolean closed = false;
private final byte[] singleByteArray = new byte[1];
public final long bytesRead() {
return this.totalBytesRead;
}
public DataSourceInputStream(DataSource dataSource, DataSpec dataSpec) {
this.dataSource = dataSource;
this.dataSpec = dataSpec;
}
public final void open() throws IOException {
checkOpened();
}
@Override // java.io.InputStream
public final int read() throws IOException {
if (read(this.singleByteArray) == -1) {
return -1;
}
return this.singleByteArray[0] & 255;
}
@Override // java.io.InputStream
public final int read(@NonNull byte[] bArr) throws IOException {
return read(bArr, 0, bArr.length);
}
@Override // java.io.InputStream
public final int read(@NonNull byte[] bArr, int i, int i2) throws IOException {
Assertions.checkState(!this.closed);
checkOpened();
int read = this.dataSource.read(bArr, i, i2);
if (read == -1) {
return -1;
}
this.totalBytesRead += read;
return read;
}
@Override // java.io.InputStream, java.io.Closeable, java.lang.AutoCloseable
public final void close() throws IOException {
if (this.closed) {
return;
}
this.dataSource.close();
this.closed = true;
}
private void checkOpened() throws IOException {
if (this.opened) {
return;
}
this.dataSource.open(this.dataSpec);
this.opened = true;
}
}