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

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

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

origin: spring-projects/spring-framework

@Override
public DefaultDataBuffer readPosition(int readPosition) {
  assertIndex(readPosition >= 0, "'readPosition' %d must be >= 0", readPosition);
  assertIndex(readPosition <= this.writePosition, "'readPosition' %d must be <= %d",
      readPosition, this.writePosition);
  this.readPosition = readPosition;
  return this;
}
origin: spring-projects/spring-framework

private void checkIndex(int index, int length) {
  assertIndex(index >= 0, "index %d must be >= 0", index);
  assertIndex(length >= 0, "length %d must be >= 0", index);
  assertIndex(index <= this.capacity, "index %d must be <= %d", index, this.capacity);
  assertIndex(length <= this.capacity, "length %d must be <= %d", index, this.capacity);
}
origin: spring-projects/spring-framework

@Override
public DefaultDataBuffer writePosition(int writePosition) {
  assertIndex(writePosition >= this.readPosition, "'writePosition' %d must be >= %d",
      writePosition, this.readPosition);
  assertIndex(writePosition <= this.capacity, "'writePosition' %d must be <= %d",
      writePosition, this.capacity);
  this.writePosition = writePosition;
  return this;
}
origin: spring-projects/spring-framework

@Override
public byte getByte(int index) {
  assertIndex(index >= 0, "index %d must be >= 0", index);
  assertIndex(index <= this.writePosition - 1, "index %d must be <= %d", index, this.writePosition - 1);
  return this.byteBuffer.get(index);
}
origin: spring-projects/spring-framework

@Override
public byte read() {
  assertIndex(this.readPosition <= this.writePosition - 1, "readPosition %d must be <= %d",
      this.readPosition, this.writePosition - 1);
  int pos = this.readPosition;
  byte b = this.byteBuffer.get(pos);
  this.readPosition = pos + 1;
  return b;
}
origin: org.springframework/spring-core

@Override
public DefaultDataBuffer readPosition(int readPosition) {
  assertIndex(readPosition >= 0, "'readPosition' %d must be >= 0", readPosition);
  assertIndex(readPosition <= this.writePosition, "'readPosition' %d must be <= %d",
      readPosition, this.writePosition);
  this.readPosition = readPosition;
  return this;
}
origin: org.springframework/spring-core

@Override
public DefaultDataBuffer writePosition(int writePosition) {
  assertIndex(writePosition >= this.readPosition, "'writePosition' %d must be >= %d",
      writePosition, this.readPosition);
  assertIndex(writePosition <= this.capacity, "'writePosition' %d must be <= %d",
      writePosition, this.capacity);
  this.writePosition = writePosition;
  return this;
}
origin: org.springframework/spring-core

private void checkIndex(int index, int length) {
  assertIndex(index >= 0, "index %d must be >= 0", index);
  assertIndex(length >= 0, "length %d must be >= 0", index);
  assertIndex(index <= this.capacity, "index %d must be <= %d", index, this.capacity);
  assertIndex(length <= this.capacity, "length %d must be <= %d", index, this.capacity);
}
origin: org.springframework/spring-core

@Override
public byte getByte(int index) {
  assertIndex(index >= 0, "index %d must be >= 0", index);
  assertIndex(index <= this.writePosition - 1, "index %d must be <= %d", index, this.writePosition - 1);
  return this.byteBuffer.get(index);
}
origin: org.springframework/spring-core

@Override
public byte read() {
  assertIndex(this.readPosition <= this.writePosition - 1, "readPosition %d must be <= %d",
      this.readPosition, this.writePosition - 1);
  int pos = this.readPosition;
  byte b = this.byteBuffer.get(pos);
  this.readPosition = pos + 1;
  return b;
}
origin: spring-projects/spring-framework

@Override
public DefaultDataBuffer read(byte[] destination, int offset, int length) {
  Assert.notNull(destination, "Byte array must not be null");
  assertIndex(this.readPosition <= this.writePosition - length,
      "readPosition %d and length %d should be smaller than writePosition %d",
      this.readPosition, length, this.writePosition);
  ByteBuffer tmp = this.byteBuffer.duplicate();
  int limit = this.readPosition + length;
  ((Buffer) tmp).clear().position(this.readPosition).limit(limit);
  tmp.get(destination, offset, length);
  this.readPosition += length;
  return this;
}
origin: org.springframework/spring-core

@Override
public DefaultDataBuffer read(byte[] destination, int offset, int length) {
  Assert.notNull(destination, "Byte array must not be null");
  assertIndex(this.readPosition <= this.writePosition - length,
      "readPosition %d and length %d should be smaller than writePosition %d",
      this.readPosition, length, this.writePosition);
  ByteBuffer tmp = this.byteBuffer.duplicate();
  int limit = this.readPosition + length;
  ((Buffer) tmp).clear().position(this.readPosition).limit(limit);
  tmp.get(destination, offset, length);
  this.readPosition += length;
  return this;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

private void checkIndex(int index, int length) {
  assertIndex(index >= 0, "index %d must be >= 0", index);
  assertIndex(length >= 0, "length %d must be >= 0", index);
  assertIndex(index <= this.capacity, "index %d must be <= %d", index, this.capacity);
  assertIndex(length <= this.capacity, "length %d must be <= %d", index, this.capacity);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

@Override
public DefaultDataBuffer writePosition(int writePosition) {
  assertIndex(writePosition >= this.readPosition, "'writePosition' %d must be >= %d",
      writePosition, this.readPosition);
  assertIndex(writePosition <= this.capacity, "'writePosition' %d must be <= %d",
      writePosition, this.capacity);
  this.writePosition = writePosition;
  return this;
}
origin: apache/servicemix-bundles

private void checkIndex(int index, int length) {
  assertIndex(index >= 0, "index %d must be >= 0", index);
  assertIndex(length >= 0, "length %d must be >= 0", index);
  assertIndex(index <= this.capacity, "index %d must be <= %d", index, this.capacity);
  assertIndex(length <= this.capacity, "length %d must be <= %d", index, this.capacity);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

@Override
public DefaultDataBuffer readPosition(int readPosition) {
  assertIndex(readPosition >= 0, "'readPosition' %d must be >= 0", readPosition);
  assertIndex(readPosition <= this.writePosition, "'readPosition' %d must be <= %d",
      readPosition, this.writePosition);
  this.readPosition = readPosition;
  return this;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

@Override
public byte getByte(int index) {
  assertIndex(index >= 0, "index %d must be >= 0", index);
  assertIndex(index <= this.writePosition - 1, "index %d must be <= %d",
      index, this.writePosition - 1);
  return this.byteBuffer.get(index);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

@Override
public byte read() {
  assertIndex(this.readPosition <= this.writePosition - 1, "readPosition %d must be <= %d",
      this.readPosition, this.writePosition - 1);
  int pos = this.readPosition;
  byte b = this.byteBuffer.get(pos);
  this.readPosition = pos + 1;
  return b;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

@Override
public DefaultDataBuffer read(byte[] destination, int offset, int length) {
  Assert.notNull(destination, "'destination' must not be null");
  assertIndex(this.readPosition <= this.writePosition - length,
      "readPosition %d and length %d should be smaller than writePosition %d",
      this.readPosition, length, this.writePosition);
  ByteBuffer tmp = this.byteBuffer.duplicate();
  int limit = this.readPosition + length;
  ((Buffer) tmp).clear().position(this.readPosition).limit(limit);
  tmp.get(destination, offset, length);
  this.readPosition += length;
  return this;
}
origin: apache/servicemix-bundles

@Override
public DefaultDataBuffer read(byte[] destination, int offset, int length) {
  Assert.notNull(destination, "Byte array must not be null");
  assertIndex(this.readPosition <= this.writePosition - length,
      "readPosition %d and length %d should be smaller than writePosition %d",
      this.readPosition, length, this.writePosition);
  ByteBuffer tmp = this.byteBuffer.duplicate();
  int limit = this.readPosition + length;
  ((Buffer) tmp).clear().position(this.readPosition).limit(limit);
  tmp.get(destination, offset, length);
  this.readPosition += length;
  return this;
}
org.springframework.core.io.bufferDefaultDataBufferassertIndex

Popular methods of DefaultDataBuffer

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getSharedPreferences (Context)
  • String (java.lang)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • BoxLayout (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Best plugins for Eclipse
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