package com.l7tech.server.url;

import com.l7tech.common.http.GenericHttpResponse;
import com.l7tech.common.io.ByteLimitInputStream;
import com.l7tech.common.mime.ContentTypeHeader;
import com.l7tech.util.IOUtils;
import java.io.IOException;

class b implements AbstractUrlObjectCache.UserObjectSource {
   final GenericHttpResponse val$sourceResponse;
   final int val$maxSize;

   b(HttpObjectCache var1, GenericHttpResponse var2, int var3) {
      this.val$sourceResponse = var2;
      this.val$maxSize = var3;
   }

   @Override
   public byte[] getBytes() throws IOException {
      return IOUtils.slurpStream(new ByteLimitInputStream(this.val$sourceResponse.getInputStream(), 1024, this.val$maxSize));
   }

   @Override
   public ContentTypeHeader getContentType() {
      return this.val$sourceResponse.getContentType();
   }

   @Override
   public String getString(boolean var1) throws IOException {
      return this.val$sourceResponse.getAsString(var1, this.val$maxSize);
   }
}
