Android ByteBuffer Create ConvToByteBuffer(byte buf[])

Here you can find the source of ConvToByteBuffer(byte buf[])

Description

Conv To Byte Buffer

Declaration

public static ByteBuffer ConvToByteBuffer(byte buf[]) 

Method Source Code

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

public class Main {
    public static ByteBuffer ConvToByteBuffer(byte buf[]) {
        ByteBuffer ReturnBuffer = ByteBuffer.allocateDirect(buf.length);

        ReturnBuffer.order(ByteOrder.nativeOrder());
        ReturnBuffer.put(buf);//from w  ww.jav  a  2s.co m
        ReturnBuffer.position(0);

        return ReturnBuffer;
    }
}

Related

  1. setupByteBuffer(ByteBuffer preBuffer, byte[] array)
  2. renewBuffer(ByteBuffer buf)
  3. allocateAudioBuffer(int size)
  4. makeByteBuffer(byte[] array)
  5. ConvToByteBuffer(byte buf[])
  6. makeByteBuffer(byte[] arr)
  7. makeByteBuffer(byte[] arr)
  8. makeByteBuffer(byte[] arr)
  9. makeByteBuffer(byte[] arr, int length)