Here you can find the source of readTs(ByteBuffer is)
public static long readTs(ByteBuffer is)
//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); } }