Android ShortBuffer Create shotToBuffer(short[] a)

Here you can find the source of shotToBuffer(short[] a)

Description

shot To Buffer

Declaration

public static ShortBuffer shotToBuffer(short[] a) 

Method Source Code

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

import java.nio.ShortBuffer;

public class Main {
    public static ShortBuffer shotToBuffer(short[] a) {
        ByteBuffer mbb = ByteBuffer.allocateDirect(a.length * 2);
        mbb.order(ByteOrder.nativeOrder());
        ShortBuffer sBuffer = mbb.asShortBuffer();
        sBuffer.put(a);/*w w  w  . j a  v a 2 s .  com*/
        sBuffer.position(0);
        return sBuffer;
    }
}

Related

  1. createDirectShortBuffer( final int capacity, final ShortBuffer previous)
  2. buildShortBuffer(short[] buffer)
  3. asShortBuffer(short[] array)
  4. getShortBuffer(short[] list)
  5. toShortBuffer(short[] array)
  6. setupShortBuffer(ShortBuffer preBuffer, short[] array)
  7. wrap(short[] buffer)
  8. ConvToShortBuffer(short buf[])
  9. ConvToShortBuffer(short buf[])