Cause: If you want to convert a float [] to memory data, check that the following two methods can convert float to byte []. Method 1: Java code: import java. nio. byteBuffer; import java. util. arrayList; float buffer = 0f; ByteBuffer bbuf = ByteBuffer. allocate (4); bbuf. putFloat (buffer); byte [] bBuffer = bbuf. array (); bBuffer = this. dataValueRollback (bBuffer); // returns the value of private byte [] dataValueRollback (byte [] data) {ArrayList <Byte> al = new ArrayList <Byte> (); for (int I = data. length-1; I> = 0; I --) {al. add (data [I]);} byte [] buffer = new byte [al. size ()]; for (int I = 0; I <= buffer. length-1; I ++) {buffer [I] = al. get (I);} return buffer;} method 2 use Float first. floatToIntBits (f) is converted to an int and then converted to byte [] by using the following method: extract four bytes from the int data and store the ** @ param n int data * @ return byte array */public static byte [] intToBytes2 (int n) {byte [] B = new byte [4]; for (int I = 0; I <4; I ++) {B [I] = (byte) (n> (24-I * 8);} return B ;} /*** convert byte array to int data ** @ param B byte array * @ return the int data generated */public static int byteToInt2 (byte [] B) {return (int) B [0]) <24) + (int) B [1]) <16) + (int) B [2]) <8) + B [3];}