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 bf = ByteBuffer.allocateDirect(size * 2);
        return bf.order(ByteOrder.nativeOrder()).asShortBuffer();
    }//from   ww w. j  a va2s. co m
}

Related

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