Android ShortBuffer Create createShortBuffer(int size)

Here you can find the source of createShortBuffer(int size)

Description

create Short Buffer

Declaration

public static ShortBuffer createShortBuffer(int size) 

Method Source Code

//package com.java2s;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import java.nio.ShortBuffer;

public class Main {
    public static ShortBuffer createShortBuffer(int size) {
        ByteBuffer bb = ByteBuffer.allocateDirect(size * 2);
        bb.order(ByteOrder.nativeOrder());
        return bb.asShortBuffer();
    }//  ww w .  ja  v a  2s  .c om
}

Related

  1. newShortBuffer(int numShorts)
  2. newShortBuffer(int numShorts)
  3. createShortBuffer(int capacity)
  4. createShortBuffer(int shortCount)
  5. createShortBuffer(int size)
  6. createShortBuffer(short[] data)
  7. createShortBuffer(short[] shortData)
  8. createShortIndicesBuffer( final int capacity)
  9. createShortIndicesBuffer( final int capacity, final ShortBuffer previous)