Here you can find the source of writeTs(ByteBuffer is, long ts)
public static void writeTs(ByteBuffer is, long ts)
//package com.java2s; /**/*www. ja va2 s . co m*/ * 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 void writeTs(ByteBuffer is, long ts) { is.put((byte) ((ts >> 29) << 1)); is.put((byte) (ts >> 22)); is.put((byte) ((ts >> 15) << 1)); is.put((byte) (ts >> 7)); is.put((byte) (ts >> 1)); } }