private static byte[] floatToByteArray(String f) {
        ByteBuffer bb = ByteBuffer.allocate(4);
        bb.order(ByteOrder.LITTLE_ENDIAN);
        bb.putFloat(Float.parseFloat(f.isEmpty() ? "0" : f));
        return bb.array();
    }