Java Float to Byte Array floatToByte(float[] values)

Here you can find the source of floatToByte(float[] values)

Description

float To Byte

License

Open Source License

Declaration

public static byte[] floatToByte(float[] values) 

Method Source Code

//package com.java2s;

public class Main {
    public static byte[] floatToByte(float[] values) {
        if (values == null) {
            return null;
        }/*from   w ww.  j  a  v a 2 s.  c o  m*/

        byte[] results = new byte[values.length];
        for (int i = 0; i < values.length; i++) {
            results[i] = (byte) values[i];
        }
        return results;
    }
}

Related

  1. floatToByteArray(float number)
  2. floatToByteArray(float source)
  3. floatToByteArray(float value)
  4. floatToByteArrayBE(float data)