Here you can find the source of allocateByteBuffer(final int bytes)
Parameter | Description |
---|---|
bytes | The size of the new byte buffer. |
public static ByteBuffer allocateByteBuffer(final int bytes)
//package com.java2s; /*/*from w w w .j a v a 2 s.com*/ * Copyright 2013 Luca Longinotti <l@longi.li> * See LICENSE.md for licensing information. */ import java.nio.ByteBuffer; public class Main { /** * Allocates a new direct {@link ByteBuffer} with the specified size and * returns it. * * @param bytes * The size of the new byte buffer. * @return The allocated direct byte buffer. */ public static ByteBuffer allocateByteBuffer(final int bytes) { return ByteBuffer.allocateDirect(bytes); } }