Here you can find the source of allocateInt()
public static IntBuffer allocateInt()
//package com.java2s; /*/* www . j av a 2 s .c o m*/ * Copyright (c) 2015 Westwood Robotics <code.westwoodrobotics@gmail.com>. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; public class Main { /** * Get an IntBuffer of size 4 with Little Endian Byte Order * @return an IntBuffer of size 4 with Little Endian byte order */ public static IntBuffer allocateInt() { ByteBuffer status = ByteBuffer.allocateDirect(4); status.order(ByteOrder.LITTLE_ENDIAN); return status.asIntBuffer(); } }