Here you can find the source of createIntBufferOnHeap(final int size)
Parameter | Description |
---|---|
size | required number of ints to store. |
public static IntBuffer createIntBufferOnHeap(final int size)
//package com.java2s; /**// w w w.jav a2s.c o m * Copyright (c) 2008-2012 Ardor Labs, Inc. * * This file is part of Ardor3D. * * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; public class Main { /** * Create a new IntBuffer of the specified size. * * @param size * required number of ints to store. * @return the new IntBuffer */ public static IntBuffer createIntBufferOnHeap(final int size) { final IntBuffer buf = ByteBuffer.allocate(4 * size).order(ByteOrder.nativeOrder()).asIntBuffer(); buf.clear(); return buf; } }