Java tutorial
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; public class Main { private static final int BYTES_PER_FLOAT = 4; public static FloatBuffer makeFloatBuffer3(float $a, float $b, float $c) { ByteBuffer b = ByteBuffer.allocateDirect(3 * BYTES_PER_FLOAT); b.order(ByteOrder.nativeOrder()); FloatBuffer buffer = b.asFloatBuffer(); buffer.put($a); buffer.put($b); buffer.put($c); buffer.position(0); return buffer; } }