Here you can find the source of createByteBuffer(int byteCount)
public static ByteBuffer createByteBuffer(int byteCount)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { private static final ByteOrder NATIVE_BYTE_ORDER = ByteOrder.nativeOrder(); public static ByteBuffer createByteBuffer(int byteCount) { return ByteBuffer.allocate(byteCount).order(NATIVE_BYTE_ORDER); }//from ww w . j ava 2s. c o m }