Here you can find the source of writeFloat(ByteBuffer buffer, float f)
public static final void writeFloat(ByteBuffer buffer, float f)
//package com.java2s; import java.nio.ByteBuffer; public class Main { public static final void writeFloat(ByteBuffer buffer, float f) { writeInt(buffer, Float.floatToIntBits(f)); }//from w ww.ja v a 2 s .co m public static final void writeInt(ByteBuffer buffer, int i) { buffer.put((byte) (i & 0xff)); buffer.put((byte) (i >>> 8)); buffer.put((byte) (i >>> 16)); buffer.put((byte) (i >>> 24)); } }