Android ShortBuffer Create newShortBuffer(int numShorts)

Here you can find the source of newShortBuffer(int numShorts)

Description

new Short Buffer

Declaration

public static ShortBuffer newShortBuffer(int numShorts) 

Method Source Code

//package com.java2s;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import java.nio.ShortBuffer;

public class Main {
    public static ShortBuffer newShortBuffer(int numShorts) {
        ByteBuffer buffer = ByteBuffer.allocateDirect(numShorts * 2);
        buffer.order(ByteOrder.nativeOrder());
        return buffer.asShortBuffer();
    }/*from  www .j  av a 2  s.  c  om*/
}

Related

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