Rabbit-R1/android (non root)/java/sources/androidx/media3/datasource/cache/ReusableBufferedOutputStream.java
2024-05-21 17:08:36 -04:00

49 lines
1.3 KiB
Java

package androidx.media3.datasource.cache;
import androidx.media3.common.util.Assertions;
import androidx.media3.common.util.Util;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.OutputStream;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public final class ReusableBufferedOutputStream extends BufferedOutputStream {
private boolean closed;
public ReusableBufferedOutputStream(OutputStream outputStream) {
super(outputStream);
}
public ReusableBufferedOutputStream(OutputStream outputStream, int i) {
super(outputStream, i);
}
@Override // java.io.FilterOutputStream, java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
public void close() throws IOException {
this.closed = true;
try {
flush();
th = null;
} catch (Throwable th) {
th = th;
}
try {
this.out.close();
} catch (Throwable th2) {
if (th == null) {
th = th2;
}
}
if (th != null) {
Util.sneakyThrow(th);
}
}
public void reset(OutputStream outputStream) {
Assertions.checkState(this.closed);
this.out = outputStream;
this.count = 0;
this.closed = false;
}
}