All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.undefinedlabs.scope.deps.okhttp3.internal.http.RealResponseBody Maven / Gradle / Ivy

Go to download

Scope is a APM for tests to give engineering teams unprecedented visibility into their CI process to quickly identify, troubleshoot and fix failed builds. This artifact contains dependencies for Scope.

There is a newer version: 0.14.0-beta.2
Show newest version
package com.undefinedlabs.scope.deps.okhttp3.internal.http;

import com.undefinedlabs.scope.deps.okhttp3.Headers;
import com.undefinedlabs.scope.deps.okhttp3.MediaType;
import com.undefinedlabs.scope.deps.okhttp3.ResponseBody;
import com.undefinedlabs.scope.deps.okio.BufferedSource;

public final class RealResponseBody extends ResponseBody {
    private final Headers headers;
    private final BufferedSource source;

    public RealResponseBody(Headers headers, BufferedSource source) {
        this.headers = headers;
        this.source = source;
    }

    @Override public MediaType contentType() {
        String contentType = headers.get("Content-Type");
        return contentType != null ? MediaType.parse(contentType) : null;
    }

    @Override public long contentLength() {
        return HttpHeaders.contentLength(headers);
    }

    @Override public BufferedSource source() {
        return source;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy