Exemple #1
0
 internal static byte[] GetI8Bytes(long[] data)
 {
     byte[] buffer = new byte[data.Length * 8];
     for (int i = 0; i < data.Length; i++)
     {
         byte[] aBytes = new byte[8];
         Array.Copy(BitConverter.GetBytes(data[i]), aBytes, 8);
         Array.Copy(Byte2SecsValue.Swap(aBytes), 0, buffer, 8 * i, 8);
     }
     return(buffer);
 }
Exemple #2
0
 internal static byte[] GetF4Bytes(float[] data)
 {
     byte[] buffer = new byte[data.Length * 4];
     for (int i = 0; i < data.Length; i++)
     {
         byte[] aBytes = new byte[4];
         Array.Copy(BitConverter.GetBytes(data[i]), aBytes, 4);
         Array.Copy(Byte2SecsValue.Swap(aBytes), 0, buffer, 4 * i, 4);
     }
     return(buffer);
 }
Exemple #3
0
 internal static double[] GetF8(byte[] aBytes)
 {
     byte[]   buffer   = new byte[8];
     double[] numArray = new double[aBytes.Length / 8];
     for (int i = 0; i < aBytes.Length; i += 8)
     {
         Array.Copy(aBytes, i, buffer, 0, buffer.Length);
         buffer = Byte2SecsValue.Swap(buffer);
         double num2 = BitConverter.ToDouble(buffer, 0);
         numArray[i / 8] = num2;
     }
     return(numArray);
 }
Exemple #4
0
 internal static float[] GetF4(byte[] aBytes)
 {
     byte[]  buffer   = new byte[4];
     float[] numArray = new float[aBytes.Length / 4];
     for (int i = 0; i < aBytes.Length; i += 4)
     {
         Array.Copy(aBytes, i, buffer, 0, buffer.Length);
         buffer = Byte2SecsValue.Swap(buffer);
         float num2 = BitConverter.ToSingle(buffer, 0);
         numArray[i / 4] = num2;
     }
     return(numArray);
 }