Java ByteBuffer Create newByteBuffer(int theSize)

Here you can find the source of newByteBuffer(int theSize)

Description

new Byte Buffer

License

Open Source License

Parameter

Parameter Description
theLength a parameter

Declaration

public static ByteBuffer newByteBuffer(int theSize) 

Method Source Code

//package com.java2s;
/*/*from  www. jav a2 s  .com*/
 * 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;

public class Main {
    /**
     * @param theLength
     * @return
     */
    public static ByteBuffer newByteBuffer(int theSize) {
        return ByteBuffer.allocate(theSize);
    }
}

Related

  1. createInputStream(final ByteBuffer buf)
  2. newByteArrayFromByteBuffer(ByteBuffer buf)
  3. newByteBuffer(int bufferSize, boolean direct)
  4. newByteBuffer(int len)
  5. newByteBuffer(int nbElements)
  6. newDirectByteBuffer(int size)