Java Utililty Methods Float Array to Byte Array

List of utility methods to do Float Array to Byte Array

  1. HOME
  2. Java
  3. F
  4. Float Array to Byte Array

Description

The list of methods to do Float Array to Byte Array are organized into topic(s).

Method

byte[] floatArrayToBytes(float[] d)
float Array To Bytes
byte[] r = new byte[d.length * 4];
for (int i = 0; i < d.length; i++) {
 byte[] s = floatToBytes(d[i]);
 for (int j = 0; j < 4; j++)
 r[4 * i + j] = s[j];
return r;
byte[] floats2bytesBE(float[] val)
floatsbytes BE
if (val == null)
 return null;
byte[] b = new byte[val.length << 2];
for (int i = 0; i < val.length; i++)
 float2bytesBE(val[i], b, i << 2);
return b;

AltStyle によって変換されたページ (->オリジナル) /