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

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

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

origin: us.ihmc/IHMCVideoCodecs

public void parse(ByteBuffer input) {
  super.parse(input);
  NIOUtils.skip(input, 4);
  flags = input.getInt();
  timescale = input.getInt();
  frameDuration = input.getInt();
  numFrames = input.get();
  NIOUtils.skip(input, 1);
}
origin: us.ihmc/ihmc-video-codecs

public void parse(ByteBuffer input) {
  super.parse(input);
  NIOUtils.skip(input, 4);
  flags = input.getInt();
  timescale = input.getInt();
  frameDuration = input.getInt();
  numFrames = input.get();
  NIOUtils.skip(input, 1);
}
origin: us.ihmc/IHMCVideoCodecs

public static void writePascalString(ByteBuffer buffer, String string, int maxLen) {
  buffer.put((byte) string.length());
  buffer.put(asciiString(string));
  skip(buffer, maxLen - string.length());
}
origin: us.ihmc/ihmc-video-codecs

public static void writePascalString(ByteBuffer buffer, String string, int maxLen) {
  buffer.put((byte) string.length());
  buffer.put(asciiString(string));
  skip(buffer, maxLen - string.length());
}
origin: us.ihmc/IHMCVideoCodecs

  public static int probe(final ByteBuffer b) {
    ByteBuffer fork = b.duplicate();
    int success = 0;
    int total = 0;
    while (fork.remaining() >= 8) {
      long len = fork.getInt() & 0xffffffffL;
      int fcc = fork.getInt();
      int hdrLen = 8;
      if (len == 1) {
        len = fork.getLong();
        hdrLen = 16;
      } else if (len < 8)
        break;
      if (fcc == ftyp && len < 64 || fcc == moov && len < 100 * 1024 * 1024 || fcc == free || fcc == mdat || fcc == wide)
        success++;
      total++;
      if (len >= Integer.MAX_VALUE)
        break;
      NIOUtils.skip(fork, (int) (len - hdrLen));
    }

    return total == 0 ? 0 : success * 100 / total;
  }
}
origin: us.ihmc/ihmc-video-codecs

  public static int probe(final ByteBuffer b) {
    ByteBuffer fork = b.duplicate();
    int success = 0;
    int total = 0;
    while (fork.remaining() >= 8) {
      long len = fork.getInt() & 0xffffffffL;
      int fcc = fork.getInt();
      int hdrLen = 8;
      if (len == 1) {
        len = fork.getLong();
        hdrLen = 16;
      } else if (len < 8)
        break;
      if (fcc == ftyp && len < 64 || fcc == moov && len < 100 * 1024 * 1024 || fcc == free || fcc == mdat || fcc == wide)
        success++;
      total++;
      if (len >= Integer.MAX_VALUE)
        break;
      NIOUtils.skip(fork, (int) (len - hdrLen));
    }

    return total == 0 ? 0 : success * 100 / total;
  }
}
origin: us.ihmc/IHMCVideoCodecs

@Override
public void parse(ByteBuffer input) {
  NIOUtils.skip(input, 1);
  profile = input.get() & 0xff;
  profileCompat = input.get() & 0xff;
  level = input.get() & 0xff;
  int flags = input.get() & 0xff;
  nalLengthSize = (flags & 0x03) + 1;
  int nSPS = input.get() & 0x1f; // 3 bits reserved + 5 bits number of
                  // sps
  for (int i = 0; i < nSPS; i++) {
    int spsSize = input.getShort();
    Assert.assertEquals(0x27, input.get() & 0x3f);
    spsList.add(NIOUtils.read(input, spsSize - 1));
  }
  int nPPS = input.get() & 0xff;
  for (int i = 0; i < nPPS; i++) {
    int ppsSize = input.getShort();
    Assert.assertEquals(0x28, input.get() & 0x3f);
    ppsList.add(NIOUtils.read(input, ppsSize - 1));
  }
}
origin: us.ihmc/ihmc-video-codecs

@Override
public void parse(ByteBuffer input) {
  NIOUtils.skip(input, 1);
  profile = input.get() & 0xff;
  profileCompat = input.get() & 0xff;
  level = input.get() & 0xff;
  int flags = input.get() & 0xff;
  nalLengthSize = (flags & 0x03) + 1;
  int nSPS = input.get() & 0x1f; // 3 bits reserved + 5 bits number of
                  // sps
  for (int i = 0; i < nSPS; i++) {
    int spsSize = input.getShort();
    Assert.assertEquals(0x27, input.get() & 0x3f);
    spsList.add(NIOUtils.read(input, spsSize - 1));
  }
  int nPPS = input.get() & 0xff;
  for (int i = 0; i < nPPS; i++) {
    int ppsSize = input.getShort();
    Assert.assertEquals(0x28, input.get() & 0x3f);
    ppsList.add(NIOUtils.read(input, ppsSize - 1));
  }
}
origin: us.ihmc/ihmc-video-codecs

public void write(ByteBuffer buf) {
  ByteBuffer dup = buf.duplicate();
  NIOUtils.skip(buf, 8);
  doWrite(buf);
  header.setBodySize(buf.position() - dup.position() - 8);
  Assert.assertEquals(header.headerSize(), 8);
  header.write(dup);
}
origin: us.ihmc/IHMCVideoCodecs

public void parse(ByteBuffer input) {
  super.parse(input);
  if (version == 0) {
    created = fromMovTime(input.getInt());
    modified = fromMovTime(input.getInt());
    timescale = input.getInt();
    duration = input.getInt();
  } else if (version == 1) {
    created = fromMovTime((int) input.getLong());
    modified = fromMovTime((int) input.getLong());
    timescale = input.getInt();
    duration = input.getLong();
  } else {
    throw new RuntimeException("Unsupported version");
  }
  rate = readRate(input);
  volume = readVolume(input);
  NIOUtils.skip(input, 10);
  matrix = readMatrix(input);
  NIOUtils.skip(input, 24);
  nextTrackId = input.getInt();
}
origin: us.ihmc/IHMCVideoCodecs

public void write(ByteBuffer buf) {
  ByteBuffer dup = buf.duplicate();
  NIOUtils.skip(buf, 8);
  doWrite(buf);
  header.setBodySize(buf.position() - dup.position() - 8);
  Assert.assertEquals(header.headerSize(), 8);
  header.write(dup);
}
origin: us.ihmc/ihmc-video-codecs

public void parse(ByteBuffer input) {
  super.parse(input);
  if (version == 0) {
    created = fromMovTime(input.getInt());
    modified = fromMovTime(input.getInt());
    timescale = input.getInt();
    duration = input.getInt();
  } else if (version == 1) {
    created = fromMovTime((int) input.getLong());
    modified = fromMovTime((int) input.getLong());
    timescale = input.getInt();
    duration = input.getLong();
  } else {
    throw new RuntimeException("Unsupported version");
  }
  rate = readRate(input);
  volume = readVolume(input);
  NIOUtils.skip(input, 10);
  matrix = readMatrix(input);
  NIOUtils.skip(input, 24);
  nextTrackId = input.getInt();
}
origin: us.ihmc/ihmc-video-codecs

volumeAttributes = is.getInt();
fsId = is.getShort();
NIOUtils.skip(is, 10);
origin: us.ihmc/IHMCVideoCodecs

volumeAttributes = is.getInt();
fsId = is.getShort();
NIOUtils.skip(is, 10);
org.jcodec.commonNIOUtilsskip

Popular methods of NIOUtils

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

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • runOnUiThread (Activity)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer 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