Here you can find the source of toByteArrayByByteBuffer(int value)
public static byte[] toByteArrayByByteBuffer(int value)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static byte[] toByteArrayByByteBuffer(int value) { return ByteBuffer.allocate(4).putInt(value).array(); }/* ww w. j a v a2 s.c om*/ }