Codota Logo
DefaultDataBuffer.ensureCapacity
Code IndexAdd Codota 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)

  • Common ways to obtain DefaultDataBuffer
private void myMethod () {
DefaultDataBuffer d =
  • Codota Iconnew DefaultDataBufferFactory().allocateBuffer()
  • Codota IconDefaultDataBufferFactory dataBufferFactory;ByteBuffer byteBuffer;new DefaultDataBuffer(dataBufferFactory, byteBuffer)
  • Codota IconDefaultDataBufferFactory defaultDataBufferFactory;defaultDataBufferFactory.allocateBuffer(initialCapacity)
  • Smart code suggestions by Codota
}
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
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JComboBox (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
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