Here you can find the source of getIntByteBuffer(int id)
public static final ByteBuffer getIntByteBuffer(int id)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { public static final int intSize = 4; public static final ByteBuffer getIntByteBuffer(int id) { ByteBuffer buffer = ByteBuffer.allocate(intSize); buffer.putInt(id);//from ww w. j ava 2 s .c o m buffer.flip(); return buffer; } }