Here you can find the source of ReadFloat(InputStream is)
public static float ReadFloat(InputStream is) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; public class Main { private static ByteBuffer bb = ByteBuffer.allocate(8); private static byte[] tempBuffer = new byte[8]; public static float ReadFloat(InputStream is) throws IOException { bb.position(0);//from www. j a v a 2 s .co m is.read(tempBuffer, 0, 4); bb.put(tempBuffer, 0, 4); return bb.getFloat(0); } }