Here you can find the source of writeHeader(int type, ByteBuffer lengthBuffer, ByteBuffer buffer)
public static void writeHeader(int type, ByteBuffer lengthBuffer, ByteBuffer buffer)
//package com.java2s; //License from project: LGPL import java.nio.ByteBuffer; public class Main { public static void writeHeader(int type, ByteBuffer lengthBuffer, ByteBuffer buffer) { buffer.put((byte) type); buffer.put(lengthBuffer);//from w w w. ja va2 s . c o m } }