Files
rr3-apk/decompiled/sources/com/mbridge/msdk/playercommon/exoplayer2/upstream/ByteArrayDataSink.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

40 lines
1.3 KiB
Java

package com.mbridge.msdk.playercommon.exoplayer2.upstream;
import com.mbridge.msdk.playercommon.exoplayer2.util.Assertions;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
/* loaded from: classes4.dex */
public final class ByteArrayDataSink implements DataSink {
private ByteArrayOutputStream stream;
@Override // com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSink
public final void open(DataSpec dataSpec) throws IOException {
long j = dataSpec.length;
if (j == -1) {
this.stream = new ByteArrayOutputStream();
} else {
Assertions.checkArgument(j <= 2147483647L);
this.stream = new ByteArrayOutputStream((int) dataSpec.length);
}
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSink
public final void close() throws IOException {
this.stream.close();
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSink
public final void write(byte[] bArr, int i, int i2) throws IOException {
this.stream.write(bArr, i, i2);
}
public final byte[] getData() {
ByteArrayOutputStream byteArrayOutputStream = this.stream;
if (byteArrayOutputStream == null) {
return null;
}
return byteArrayOutputStream.toByteArray();
}
}