Java tutorial
//package com.java2s; public class Main { public static void putFloat(byte[] bb, float x, int index) { // byte[] b = new byte[4]; int l = Float.floatToIntBits(x); for (int i = 0; i < 4; i++) { bb[index + i] = Integer.valueOf(l).byteValue(); l = l >> 8; } } }