58 lines
1.3 KiB
Java
58 lines
1.3 KiB
Java
package com.facebook;
|
|
|
|
import android.os.Handler;
|
|
import java.io.OutputStream;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
class ProgressNoopOutputStream extends OutputStream implements RequestOutputStream {
|
|
private final Map<GraphRequest, RequestProgress> a = new HashMap();
|
|
private final Handler b;
|
|
private GraphRequest c;
|
|
private RequestProgress d;
|
|
private int e;
|
|
|
|
ProgressNoopOutputStream(Handler handler) {
|
|
this.b = handler;
|
|
}
|
|
|
|
@Override // com.facebook.RequestOutputStream
|
|
public void a(GraphRequest graphRequest) {
|
|
this.c = graphRequest;
|
|
this.d = graphRequest != null ? this.a.get(graphRequest) : null;
|
|
}
|
|
|
|
Map<GraphRequest, RequestProgress> b() {
|
|
return this.a;
|
|
}
|
|
|
|
@Override // java.io.OutputStream
|
|
public void write(byte[] bArr) {
|
|
a(bArr.length);
|
|
}
|
|
|
|
@Override // java.io.OutputStream
|
|
public void write(byte[] bArr, int i, int i2) {
|
|
a(i2);
|
|
}
|
|
|
|
@Override // java.io.OutputStream
|
|
public void write(int i) {
|
|
a(1L);
|
|
}
|
|
|
|
int a() {
|
|
return this.e;
|
|
}
|
|
|
|
void a(long j) {
|
|
if (this.d == null) {
|
|
this.d = new RequestProgress(this.b, this.c);
|
|
this.a.put(this.c, this.d);
|
|
}
|
|
this.d.b(j);
|
|
this.e = (int) (this.e + j);
|
|
}
|
|
}
|