Android ShortBuffer Create toShortBuffer(short[] array)

Here you can find the source of toShortBuffer(short[] array)

Description

to Short Buffer

License

Apache License

Declaration

public static ShortBuffer toShortBuffer(short[] array) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.nio.*;

public class Main {
    public static ShortBuffer toShortBuffer(short[] array) {
        ByteBuffer bb = ByteBuffer.allocateDirect(array.length << 1);
        bb.order(ByteOrder.nativeOrder());
        bb.position(0);//from  ww w  .  j  av  a2  s  .com
        ShortBuffer sbb = bb.asShortBuffer();
        sbb.put(array);
        return sbb;
    }
}

Related

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