Tabnine Logo
HeapByteBuffer
Code IndexAdd Tabnine to your IDE (free)

How to use
HeapByteBuffer
in
java.nio

Best Java code snippets using java.nio.HeapByteBuffer (Showing top 20 results out of 315)

origin: libgdx/libgdx

static ReadWriteHeapByteBuffer copy (HeapByteBuffer other, int markOfOther) {
  ReadWriteHeapByteBuffer buf = new ReadWriteHeapByteBuffer(other.backingArray, other.capacity(), other.offset);
  buf.limit = other.limit();
  buf.position = other.position();
  buf.mark = markOfOther;
  buf.order(other.order());
  return buf;
}
origin: libgdx/libgdx

public final float getFloat () {
  return Numbers.intBitsToFloat(getInt());
}
origin: libgdx/libgdx

public final double getDouble (int index) {
  return Numbers.longBitsToDouble(getLong(index));
}
origin: libgdx/libgdx

public final long getLong (int index) {
  if (index < 0 || index + 8 > limit) {
    throw new IndexOutOfBoundsException();
  }
  return loadLong(index);
}
origin: libgdx/libgdx

public final int getInt (int index) {
  if (index < 0 || index + 4 > limit) {
    throw new IndexOutOfBoundsException();
  }
  return loadInt(index);
}
origin: libgdx/libgdx

public final short getShort (int index) {
  if (index < 0 || index + 2 > limit) {
    throw new IndexOutOfBoundsException();
  }
  return loadShort(index);
}
origin: libgdx/libgdx

public final ByteBuffer get (byte[] dest, int off, int len) {
  int length = dest.length;
  if (off < 0 || len < 0 || (long)off + (long)len > length) {
    throw new IndexOutOfBoundsException();
  }
  if (len > remaining()) {
    throw new BufferUnderflowException();
  }
  System.arraycopy(backingArray, offset + position, dest, off, len);
  position += len;
  return this;
}
origin: libgdx/libgdx

public final long getLong (int index) {
  if (index < 0 || index + 8 > limit) {
    throw new IndexOutOfBoundsException();
  }
  return loadLong(index);
}
origin: libgdx/libgdx

public final int getInt (int index) {
  if (index < 0 || index + 4 > limit) {
    throw new IndexOutOfBoundsException();
  }
  return loadInt(index);
}
origin: libgdx/libgdx

public final short getShort (int index) {
  if (index < 0 || index + 2 > limit) {
    throw new IndexOutOfBoundsException();
  }
  return loadShort(index);
}
origin: libgdx/libgdx

public final ByteBuffer get (byte[] dest, int off, int len) {
  int length = dest.length;
  if (off < 0 || len < 0 || (long)off + (long)len > length) {
    throw new IndexOutOfBoundsException();
  }
  if (len > remaining()) {
    throw new BufferUnderflowException();
  }
  System.arraycopy(backingArray, offset + position, dest, off, len);
  position += len;
  return this;
}
origin: libgdx/libgdx

static ReadWriteHeapByteBuffer copy (HeapByteBuffer other, int markOfOther) {
  ReadWriteHeapByteBuffer buf = new ReadWriteHeapByteBuffer(other.backingArray, other.capacity(), other.offset);
  buf.limit = other.limit();
  buf.position = other.position();
  buf.mark = markOfOther;
  buf.order(other.order());
  return buf;
}
origin: libgdx/libgdx

public final long getLong () {
  int newPosition = position + 8;
  if (newPosition > limit) {
    throw new BufferUnderflowException();
  }
  long result = loadLong(position);
  position = newPosition;
  return result;
}
origin: libgdx/libgdx

public final int getInt () {
  int newPosition = position + 4;
  if (newPosition > limit) {
    throw new BufferUnderflowException();
  }
  int result = loadInt(position);
  position = newPosition;
  return result;
}
origin: libgdx/libgdx

public final short getShort () {
  int newPosition = position + 2;
  if (newPosition > limit) {
    throw new BufferUnderflowException();
  }
  short result = loadShort(position);
  position = newPosition;
  return result;
}
origin: libgdx/libgdx

public final double getDouble () {
  return Numbers.longBitsToDouble(getLong());
}
origin: libgdx/libgdx

public final float getFloat (int index) {
  return Numbers.intBitsToFloat(getInt(index));
}
origin: thothbot/parallax

public final ByteBuffer get (byte[] dest, int off, int len) {
  int length = dest.length;
  if (off < 0 || len < 0 || (long)off + (long)len > length) {
    throw new IndexOutOfBoundsException();
  }
  if (len > remaining()) {
    throw new BufferUnderflowException();
  }
  System.arraycopy(backingArray, offset + position, dest, off, len);
  position += len;
  return this;
}
origin: libgdx/libgdx

static ReadOnlyHeapByteBuffer copy (HeapByteBuffer other, int markOfOther) {
  ReadOnlyHeapByteBuffer buf = new ReadOnlyHeapByteBuffer(other.backingArray, other.capacity(), other.offset);
  buf.limit = other.limit();
  buf.position = other.position();
  buf.mark = markOfOther;
  buf.order(other.order());
  return buf;
}
origin: libgdx/libgdx

public final long getLong () {
  int newPosition = position + 8;
  if (newPosition > limit) {
    throw new BufferUnderflowException();
  }
  long result = loadLong(position);
  position = newPosition;
  return result;
}
java.nioHeapByteBuffer

Javadoc

HeapByteBuffer, ReadWriteHeapByteBuffer and ReadOnlyHeapByteBuffer compose the implementation of array based byte buffers.

HeapByteBuffer implements all the shared readonly methods and is extended by the other two classes.

All methods are marked final for runtime performance.

Most used methods

  • capacity
  • getInt
  • getLong
  • limit
  • loadInt
  • loadLong
  • loadShort
  • order
  • position
  • remaining
  • <init>
  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Github Copilot alternatives
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