com.eg.agent.android.instrumentation.httpclient.ContentBufferingResponseEntityImpl Maven / Gradle / Ivy
The newest version!
/*
* Decompiled with CFR 0.137.
*
* Could not load the following classes:
* org.apache.http.Header
* org.apache.http.HttpEntity
*/
package com.eg.agent.android.instrumentation.httpclient;
import com.eg.agent.android.instrumentation.io.CountingInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
public class ContentBufferingResponseEntityImpl
implements HttpEntity {
final HttpEntity impl;
private CountingInputStream contentStream;
public ContentBufferingResponseEntityImpl(HttpEntity impl) {
if (impl == null) {
throw new IllegalArgumentException("Missing wrapped entity");
}
this.impl = impl;
}
public void consumeContent() throws IOException {
this.impl.consumeContent();
}
public InputStream getContent() throws IOException, IllegalStateException {
if (this.contentStream != null) {
return this.contentStream;
}
this.contentStream = new CountingInputStream(this.impl.getContent(), true);
return this.contentStream;
}
public Header getContentEncoding() {
return this.impl.getContentEncoding();
}
public long getContentLength() {
return this.impl.getContentLength();
}
public Header getContentType() {
return this.impl.getContentType();
}
public boolean isChunked() {
return this.impl.isChunked();
}
public boolean isRepeatable() {
return this.impl.isRepeatable();
}
public boolean isStreaming() {
return this.impl.isStreaming();
}
public void writeTo(OutputStream outputStream) throws IOException {
this.impl.writeTo(outputStream);
}
}