Rabbit-R1/original r1/java/sources/okhttp3/internal/http1/HeadersReader.java
2024-05-21 17:08:36 -04:00

44 lines
2.1 KiB
Java

package okhttp3.internal.http1;
import io.sentry.protocol.TransactionInfo;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import okhttp3.Headers;
import okio.BufferedSource;
/* compiled from: HeadersReader.kt */
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\u0018\u0000 \r2\u00020\u0001:\u0001\rB\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0006\u0010\t\u001a\u00020\nJ\u0006\u0010\u000b\u001a\u00020\fR\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\\u0006\u000e"}, d2 = {"Lokhttp3/internal/http1/HeadersReader;", "", TransactionInfo.JsonKeys.SOURCE, "Lokio/BufferedSource;", "(Lokio/BufferedSource;)V", "headerLimit", "", "getSource", "()Lokio/BufferedSource;", "readHeaders", "Lokhttp3/Headers;", "readLine", "", "Companion", "okhttp"}, k = 1, mv = {1, 4, 0})
/* loaded from: classes3.dex */
public final class HeadersReader {
private static final int HEADER_LIMIT = 262144;
private long headerLimit;
private final BufferedSource source;
public final BufferedSource getSource() {
return this.source;
}
public HeadersReader(BufferedSource source) {
Intrinsics.checkNotNullParameter(source, "source");
this.source = source;
this.headerLimit = 262144;
}
public final String readLine() {
String readUtf8LineStrict = this.source.readUtf8LineStrict(this.headerLimit);
this.headerLimit -= readUtf8LineStrict.length();
return readUtf8LineStrict;
}
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();
}
}
}
}