Here you can find the source of newDirectIntBuffer(final int theSize)
public static IntBuffer newDirectIntBuffer(final int theSize)
//package com.java2s; /*//from w w w . jav a 2s .co m * Copyright (c) 2013 christianr. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v3 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-3.0.html * * Contributors: * christianr - initial API and implementation */ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; public class Main { public static final int SIZE_OF_INT = 4; public static IntBuffer newDirectIntBuffer(final int theSize) { ByteBuffer myBuffer = ByteBuffer.allocateDirect(theSize * SIZE_OF_INT); myBuffer.order(ByteOrder.nativeOrder()); return myBuffer.asIntBuffer(); } }