Here you can find the source of createByteBuffer(int capacity)
Parameter | Description |
---|---|
capacity | The capacity, in bytes |
public static ByteBuffer createByteBuffer(int capacity)
//package com.java2s; /*/* w ww . ja va 2 s. co m*/ * Copyright LWJGL. All rights reserved. * License terms: http://lwjgl.org/license.php */ import java.nio.*; public class Main { /** * Allocates a direct native-ordered bytebuffer with the specified capacity. * * @param capacity The capacity, in bytes * * @return a ByteBuffer */ public static ByteBuffer createByteBuffer(int capacity) { return ByteBuffer.allocateDirect(capacity).order(ByteOrder.nativeOrder()); } }