Codota Logo
ContentBufferEntity.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.apache.http.nio.entity.ContentBufferEntity
constructor

Best Java code snippets using org.apache.http.nio.entity.ContentBufferEntity.<init> (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: com.atlassian.httpclient/atlassian-httpclient-library

protected void onEntityEnclosed(HttpEntity entity, ContentType contentType) throws IOException {
  int length = Math.min(Ints.saturatedCast(entity.getContentLength()), maxEntitySize);
  if (length < 0L) {
    // start with a 4k buffer
    length = Math.min(4096, maxEntitySize);
  }
  int initialBufferSize = Math.min(MAX_INITIAL_BUFFER_SIZE, length);
  buf = new BoundedInputBuffer(initialBufferSize, maxEntitySize, new HeapByteBufferAllocator());
  Asserts.notNull(response, "response");
  response.setEntity(new ContentBufferEntity(entity, buf));
}
origin: com.strapdata.elasticsearch.client/elasticsearch-rest-client

@Override
protected void onEntityEnclosed(HttpEntity entity, ContentType contentType) throws IOException {
  long len = entity.getContentLength();
  if (len > bufferLimitBytes) {
    throw new ContentTooLongException("entity content is too long [" + len +
        "] for the configured buffer limit [" + bufferLimitBytes + "]");
  }
  if (len < 0) {
    len = 4096;
  }
  this.buf = new SimpleInputBuffer((int) len, getByteBufferAllocator());
  this.response.setEntity(new ContentBufferEntity(entity, this.buf));
}
origin: org.elasticsearch.client/rest

@Override
protected void onEntityEnclosed(HttpEntity entity, ContentType contentType) throws IOException {
  long len = entity.getContentLength();
  if (len > bufferLimitBytes) {
    throw new ContentTooLongException("entity content is too long [" + len +
        "] for the configured buffer limit [" + bufferLimitBytes + "]");
  }
  if (len < 0) {
    len = 4096;
  }
  this.buf = new SimpleInputBuffer((int) len, getByteBufferAllocator());
  this.response.setEntity(new ContentBufferEntity(entity, this.buf));
}
origin: apache/servicemix-bundles

@Override
protected void onEntityEnclosed(HttpEntity entity, ContentType contentType) throws IOException {
  long len = entity.getContentLength();
  if (len > bufferLimitBytes) {
    throw new ContentTooLongException("entity content is too long [" + len +
        "] for the configured buffer limit [" + bufferLimitBytes + "]");
  }
  if (len < 0) {
    len = 4096;
  }
  this.buf = new SimpleInputBuffer((int) len, getByteBufferAllocator());
  this.response.setEntity(new ContentBufferEntity(entity, this.buf));
}
origin: PreferredAI/venom

@Override
protected final void onEntityEnclosed(final HttpEntity entity, final ContentType contentType) throws IOException {
 long len = entity.getContentLength();
 if (len > Integer.MAX_VALUE) {
  throw new ContentTooLongException("Entity content is too long: " + len);
 }
 if (len < 0) {
  len = 4096;
 }
 this.buf = new SimpleInputBuffer((int) len, new HeapByteBufferAllocator());
 this.httpResponse.setEntity(new ContentBufferEntity(entity, this.buf));
}
origin: com.bugvm/bugvm-rt

@Override
protected void onEntityEnclosed(
    final HttpEntity entity, final ContentType contentType) throws IOException {
  long len = entity.getContentLength();
  if (len > Integer.MAX_VALUE) {
    throw new ContentTooLongException("Entity content is too long: " + len);
  }
  if (len < 0) {
    len = 4096;
  }
  this.buf = new SimpleInputBuffer((int) len, new HeapByteBufferAllocator());
  this.response.setEntity(new ContentBufferEntity(entity, this.buf));
}
origin: ibinti/bugvm

@Override
protected void onEntityEnclosed(
    final HttpEntity entity, final ContentType contentType) throws IOException {
  long len = entity.getContentLength();
  if (len > Integer.MAX_VALUE) {
    throw new ContentTooLongException("Entity content is too long: " + len);
  }
  if (len < 0) {
    len = 4096;
  }
  this.buf = new SimpleInputBuffer((int) len, new HeapByteBufferAllocator());
  this.response.setEntity(new ContentBufferEntity(entity, this.buf));
}
origin: ibinti/bugvm

@Override
protected void onEntityEnclosed(
    final HttpEntity entity, final ContentType contentType) throws IOException {
  long len = entity.getContentLength();
  if (len > Integer.MAX_VALUE) {
    throw new ContentTooLongException("Entity content is too long: " + len);
  }
  if (len < 0) {
    len = 4096;
  }
  this.buf = new SimpleInputBuffer((int) len, new HeapByteBufferAllocator());
  ((HttpEntityEnclosingRequest) this.request).setEntity(
      new ContentBufferEntity(entity, this.buf));
}
origin: com.bugvm/bugvm-rt

@Override
protected void onEntityEnclosed(
    final HttpEntity entity, final ContentType contentType) throws IOException {
  long len = entity.getContentLength();
  if (len > Integer.MAX_VALUE) {
    throw new ContentTooLongException("Entity content is too long: " + len);
  }
  if (len < 0) {
    len = 4096;
  }
  this.buf = new SimpleInputBuffer((int) len, new HeapByteBufferAllocator());
  ((HttpEntityEnclosingRequest) this.request).setEntity(
      new ContentBufferEntity(entity, this.buf));
}
origin: com.aliyun.openservices/tablestore

@Override
protected void onEntityEnclosed(final HttpEntity entity,
    final ContentType contentType) throws IOException {
  long len = entity.getContentLength();
  if (len > Integer.MAX_VALUE) {
    throw new ContentTooLongException("Entity content is too long: "
        + len);
  }
  if (len < 0) {
    len = BUFFER_SIZE;
  }
  this.buf = new SimpleInputBuffer((int) len,
      new HeapByteBufferAllocator());
  this.httpResponse.setEntity(new ContentBufferEntity(entity, this.buf));
}
origin: org.apache.camel/camel-jhc

entityReq.setEntity(new ContentBufferEntity(
    entityReq.getEntity(),
    connState.getInbuffer()));
org.apache.http.nio.entityContentBufferEntity<init>

Javadoc

Creates new instance of ContentBufferEntity.

Popular methods of ContentBufferEntity

  • setContent
  • getContent

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • notifyDataSetChanged (ArrayAdapter)
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Collectors (java.util.stream)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now