Tabnine Logo
DefaultDataBuffer.ensureCapacity
Code IndexAdd Tabnine to your IDE (free)

How to use
ensureCapacity
method
in
org.springframework.core.io.buffer.DefaultDataBuffer

Best Java code snippets using org.springframework.core.io.buffer.DefaultDataBuffer.ensureCapacity (Showing top 12 results out of 315)

origin: spring-projects/spring-framework

@Override
public DefaultDataBuffer write(byte b) {
  ensureCapacity(1);
  int pos = this.writePosition;
  this.byteBuffer.put(pos, b);
  this.writePosition = pos + 1;
  return this;
}
origin: spring-projects/spring-framework

@Override
public DefaultDataBuffer write(ByteBuffer... buffers) {
  if (!ObjectUtils.isEmpty(buffers)) {
    int capacity = Arrays.stream(buffers).mapToInt(ByteBuffer::remaining).sum();
    ensureCapacity(capacity);
    Arrays.stream(buffers).forEach(this::write);
  }
  return this;
}
origin: org.springframework/spring-core

@Override
public DefaultDataBuffer write(byte b) {
  ensureCapacity(1);
  int pos = this.writePosition;
  this.byteBuffer.put(pos, b);
  this.writePosition = pos + 1;
  return this;
}
origin: spring-projects/spring-framework

@Override
public DefaultDataBuffer write(byte[] source, int offset, int length) {
  Assert.notNull(source, "Byte array must not be null");
  ensureCapacity(length);
  ByteBuffer tmp = this.byteBuffer.duplicate();
  int limit = this.writePosition + length;
  ((Buffer) tmp).clear().position(this.writePosition).limit(limit);
  tmp.put(source, offset, length);
  this.writePosition += length;
  return this;
}
origin: org.springframework/spring-core

@Override
public DefaultDataBuffer write(ByteBuffer... buffers) {
  if (!ObjectUtils.isEmpty(buffers)) {
    int capacity = Arrays.stream(buffers).mapToInt(ByteBuffer::remaining).sum();
    ensureCapacity(capacity);
    Arrays.stream(buffers).forEach(this::write);
  }
  return this;
}
origin: org.springframework/spring-core

@Override
public DefaultDataBuffer write(byte[] source, int offset, int length) {
  Assert.notNull(source, "Byte array must not be null");
  ensureCapacity(length);
  ByteBuffer tmp = this.byteBuffer.duplicate();
  int limit = this.writePosition + length;
  ((Buffer) tmp).clear().position(this.writePosition).limit(limit);
  tmp.put(source, offset, length);
  this.writePosition += length;
  return this;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

@Override
public DefaultDataBuffer write(byte b) {
  ensureCapacity(1);
  int pos = this.writePosition;
  this.byteBuffer.put(pos, b);
  this.writePosition = pos + 1;
  return this;
}
origin: apache/servicemix-bundles

@Override
public DefaultDataBuffer write(byte b) {
  ensureCapacity(1);
  int pos = this.writePosition;
  this.byteBuffer.put(pos, b);
  this.writePosition = pos + 1;
  return this;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

@Override
public DefaultDataBuffer write(ByteBuffer... byteBuffers) {
  Assert.notEmpty(byteBuffers, "'byteBuffers' must not be empty");
  int capacity = Arrays.stream(byteBuffers).mapToInt(ByteBuffer::remaining).sum();
  ensureCapacity(capacity);
  Arrays.stream(byteBuffers).forEach(this::write);
  return this;
}
origin: apache/servicemix-bundles

@Override
public DefaultDataBuffer write(ByteBuffer... buffers) {
  if (!ObjectUtils.isEmpty(buffers)) {
    int capacity = Arrays.stream(buffers).mapToInt(ByteBuffer::remaining).sum();
    ensureCapacity(capacity);
    Arrays.stream(buffers).forEach(this::write);
  }
  return this;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

@Override
public DefaultDataBuffer write(byte[] source, int offset, int length) {
  Assert.notNull(source, "'source' must not be null");
  ensureCapacity(length);
  ByteBuffer tmp = this.byteBuffer.duplicate();
  int limit = this.writePosition + length;
  ((Buffer) tmp).clear().position(this.writePosition).limit(limit);
  tmp.put(source, offset, length);
  this.writePosition += length;
  return this;
}
origin: apache/servicemix-bundles

@Override
public DefaultDataBuffer write(byte[] source, int offset, int length) {
  Assert.notNull(source, "Byte array must not be null");
  ensureCapacity(length);
  ByteBuffer tmp = this.byteBuffer.duplicate();
  int limit = this.writePosition + length;
  ((Buffer) tmp).clear().position(this.writePosition).limit(limit);
  tmp.put(source, offset, length);
  this.writePosition += length;
  return this;
}
org.springframework.core.io.bufferDefaultDataBufferensureCapacity

Popular methods of DefaultDataBuffer

  • write
  • <init>
  • allocate
  • asByteBuffer
  • assertIndex
  • calculateCapacity
    Calculate the capacity of the buffer.
  • capacity
  • checkIndex
  • fromEmptyByteBuffer
  • fromFilledByteBuffer
  • read
  • readPosition
  • read,
  • readPosition,
  • readableByteCount,
  • setNativeBuffer,
  • writableByteCount,
  • writePosition,
  • getNativeBuffer

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • notifyDataSetChanged (ArrayAdapter)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JFileChooser (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now