Here you can find the source of createByteBuffer(byte... values)
Parameter | Description |
---|---|
values | the values |
public static ByteBuffer createByteBuffer(byte... values)
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { /**// w ww. j ava2 s. c o m * Constructs a direct native-ordered bytebuffer with the specified size. * * @param size The size, in bytes * * @return a ByteBuffer */ public static ByteBuffer createByteBuffer(int size) { return (ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder())); } /** * Constructs a direct native-ordered bytebuffer with the specified size. * * @param values the values * * @return a ByteBuffer */ public static ByteBuffer createByteBuffer(byte... values) { ByteBuffer buff = createByteBuffer(values.length); buff.flip(); return (buff); } }