public static double parseFloat ( InputStream inputStream , final int size ) throws IOException { byte [ ] buffer = new byte [ size ] ; int numberOfReadsBytes = inputStream . read ( buffer , 0 , size ) ; assert numberOfReadsBytes == size ; ByteBuffer byteBuffer = ByteBuffer . wrap ( buffer ) . order ( ByteOrder . BIG_ENDIAN ) ; if ( 8 == size ) { return byteBuffer . getDouble ( ) ; } return byteBuffer . getFloat ( ) ; }
method used to parse float and double