Tabnine Logo
NIOUtils.toArray
Code IndexAdd Tabnine to your IDE (free)

How to use
toArray
method
in
org.jcodec.common.NIOUtils

Best Java code snippets using org.jcodec.common.NIOUtils.toArray (Showing top 16 results out of 315)

origin: us.ihmc/IHMCVideoCodecs

public static int find(List<ByteBuffer> catalog, ByteBuffer key) {
  byte[] keyA = toArray(key);
  for (int i = 0; i < catalog.size(); i++) {
    if (Arrays.equals(toArray(catalog.get(i)), keyA))
      return i;
  }
  return -1;
}
origin: us.ihmc/ihmc-video-codecs

public static int find(List<ByteBuffer> catalog, ByteBuffer key) {
  byte[] keyA = toArray(key);
  for (int i = 0; i < catalog.size(); i++) {
    if (Arrays.equals(toArray(catalog.get(i)), keyA))
      return i;
  }
  return -1;
}
origin: us.ihmc/ihmc-video-codecs

public static String readNullTermString(ByteBuffer buffer, Charset charset) {
  ByteBuffer fork = buffer.duplicate();
  while (buffer.hasRemaining() && buffer.get() != 0)
    ;
  if (buffer.hasRemaining())
    fork.limit(buffer.position() - 1);
  return new String(toArray(fork), charset);
}
origin: us.ihmc/IHMCVideoCodecs

public static void write(ByteBuffer to, ByteBuffer from, int count) {
  if (from.hasArray()) {
    to.put(from.array(), from.arrayOffset() + from.position(), Math.min(from.remaining(), count));
  } else {
    to.put(toArray(from, count));
  }
}
origin: us.ihmc/IHMCVideoCodecs

public static String readNullTermString(ByteBuffer buffer, Charset charset) {
  ByteBuffer fork = buffer.duplicate();
  while (buffer.hasRemaining() && buffer.get() != 0)
    ;
  if (buffer.hasRemaining())
    fork.limit(buffer.position() - 1);
  return new String(toArray(fork), charset);
}
origin: us.ihmc/ihmc-video-codecs

public static void write(ByteBuffer to, ByteBuffer from, int count) {
  if (from.hasArray()) {
    to.put(from.array(), from.arrayOffset() + from.position(), Math.min(from.remaining(), count));
  } else {
    to.put(toArray(from, count));
  }
}
origin: us.ihmc/IHMCVideoCodecs

public static void write(ByteBuffer to, ByteBuffer from) {
  if (from.hasArray()) {
    to.put(from.array(), from.arrayOffset() + from.position(), Math.min(to.remaining(), from.remaining()));
  } else {
    to.put(toArray(from, to.remaining()));
  }
}
origin: us.ihmc/ihmc-video-codecs

public static void write(ByteBuffer to, ByteBuffer from) {
  if (from.hasArray()) {
    to.put(from.array(), from.arrayOffset() + from.position(), Math.min(to.remaining(), from.remaining()));
  } else {
    to.put(toArray(from, to.remaining()));
  }
}
origin: us.ihmc/ihmc-video-codecs

public static String readString(ByteBuffer buffer, int len) {
  return new String(toArray(read(buffer, len)));
}
origin: us.ihmc/IHMCVideoCodecs

public static String readString(ByteBuffer buffer, int len) {
  return new String(toArray(read(buffer, len)));
}
origin: us.ihmc/IHMCVideoCodecs

public static String readPascalString(ByteBuffer buffer, int maxLen) {
  ByteBuffer sub = read(buffer, maxLen + 1);
  return new String(toArray(NIOUtils.read(sub, Math.min(sub.get() & 0xff, maxLen))));
}
origin: us.ihmc/ihmc-video-codecs

public static String readPascalString(ByteBuffer buffer, int maxLen) {
  ByteBuffer sub = read(buffer, maxLen + 1);
  return new String(toArray(NIOUtils.read(sub, Math.min(sub.get() & 0xff, maxLen))));
}
origin: us.ihmc/IHMCVideoCodecs

  break;
int len = is.getShort();
byte[] bs = NIOUtils.toArray(NIOUtils.read(is, (len + 1) & 0xfffffffe));
if (bs == null)
  break;
origin: us.ihmc/ihmc-video-codecs

  break;
int len = is.getShort();
byte[] bs = NIOUtils.toArray(NIOUtils.read(is, (len + 1) & 0xfffffffe));
if (bs == null)
  break;
origin: us.ihmc/ihmc-video-codecs

obj = NIOUtils.toArray((ByteBuffer) obj);
origin: us.ihmc/IHMCVideoCodecs

obj = NIOUtils.toArray((ByteBuffer) obj);
org.jcodec.commonNIOUtilstoArray

Popular methods of NIOUtils

  • readableFileChannel
  • closeQuietly
  • writableFileChannel
  • combine
  • copy
  • fetchFrom
  • map
  • read
  • readNullTermString
  • readPascalString
  • readString
  • skip
  • readString,
  • skip,
  • write,
  • writeLong,
  • writePascalString

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • 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