53 lines
1.4 KiB
Java
53 lines
1.4 KiB
Java
|
package okhttp3.internal.http1;
|
||
|
|
||
|
import o.C14953gcr;
|
||
|
import o.C14957gcv;
|
||
|
import o.InterfaceC15149gid;
|
||
|
import okhttp3.Headers;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public final class HeadersReader {
|
||
|
public static final Companion Companion = new Companion(null);
|
||
|
private static final int HEADER_LIMIT = 262144;
|
||
|
private long headerLimit;
|
||
|
private final InterfaceC15149gid source;
|
||
|
|
||
|
public HeadersReader(InterfaceC15149gid interfaceC15149gid) {
|
||
|
C14957gcv.e(interfaceC15149gid, "");
|
||
|
this.source = interfaceC15149gid;
|
||
|
this.headerLimit = 262144L;
|
||
|
}
|
||
|
|
||
|
public final String readLine() {
|
||
|
String b = this.source.b(this.headerLimit);
|
||
|
this.headerLimit -= b.length();
|
||
|
return b;
|
||
|
}
|
||
|
|
||
|
public final Headers readHeaders() {
|
||
|
Headers.Builder builder = new Headers.Builder();
|
||
|
while (true) {
|
||
|
String readLine = readLine();
|
||
|
if (readLine.length() != 0) {
|
||
|
builder.addLenient$okhttp(readLine);
|
||
|
} else {
|
||
|
return builder.build();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public static final class Companion {
|
||
|
private Companion() {
|
||
|
}
|
||
|
|
||
|
public /* synthetic */ Companion(C14953gcr c14953gcr) {
|
||
|
this();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public final InterfaceC15149gid getSource() {
|
||
|
return this.source;
|
||
|
}
|
||
|
}
|