Java ByteBuffer Read readTs(ByteBuffer is)

Here you can find the source of readTs(ByteBuffer is)

Description

read Ts

License

BSD License

Declaration

public static long readTs(ByteBuffer is) 

Method Source Code

//package com.java2s;
/**//from w  w w.  j  a v a2s.com
 * This class is part of JCodec ( www.jcodec.org ) This software is distributed
 * under FreeBSD License
 * 
 * Demuxer for MPEG Program Stream format
 * 
 * @author The JCodec project
 * 
 */

import java.nio.ByteBuffer;

public class Main {
    public static long readTs(ByteBuffer is) {
        return (((long) is.get() & 0x0e) << 29) | ((is.get() & 0xff) << 22)
                | (((is.get() & 0xff) >> 1) << 15)
                | ((is.get() & 0xff) << 7) | ((is.get() & 0xff) >> 1);
    }
}

Related

  1. readSignedVarint(ByteBuffer buffer)
  2. readSize(ByteBuffer buf)
  3. readSize(ByteBuffer buffer)
  4. readSmart(ByteBuffer buffer)
  5. readToBytes(ByteBuffer byteBuffer)
  6. readTs(ByteBuffer is, int c)
  7. readUUID(ByteBuffer buffer)
  8. readVariableLength(ByteBuffer buf)
  9. readVInt(ByteBuffer bb)