Here you can find the source of toFloat(byte[] bytes)
Parameter | Description |
---|---|
bytes | a parameter |
public static float toFloat(byte[] bytes)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { /**//from ww w . ja va 2s .c o m * Converts a byte array to a float value * @param bytes * @return the long value */ public static float toFloat(byte[] bytes) { if (bytes == null || bytes.length == 0) { return -1L; } return ByteBuffer.wrap(bytes).getFloat(); } }