Rabbit-R1/switch port/java/sources/com/google/common/io/CountingOutputStream.java
2024-05-21 17:08:36 -04:00

37 lines
1.1 KiB
Java

package com.google.common.io;
import com.google.common.base.Preconditions;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@ElementTypesAreNonnullByDefault
/* loaded from: classes3.dex */
public final class CountingOutputStream extends FilterOutputStream {
private long count;
public long getCount() {
return this.count;
}
public CountingOutputStream(OutputStream outputStream) {
super((OutputStream) Preconditions.checkNotNull(outputStream));
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public void write(byte[] bArr, int i, int i2) throws IOException {
this.out.write(bArr, i, i2);
this.count += i2;
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public void write(int i) throws IOException {
this.out.write(i);
this.count++;
}
@Override // java.io.FilterOutputStream, java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
public void close() throws IOException {
this.out.close();
}
}