示例#1
0
文件: java.io.cs 项目: sreejukg/ikvm
 public static void doublesToBytes(double[] src, int srcpos, byte[] dst, int dstpos, int ndoubles)
 {
     IKVM.Runtime.DoubleConverter converter = new IKVM.Runtime.DoubleConverter();
     for (int i = 0; i < ndoubles; i++)
     {
         long v = IKVM.Runtime.DoubleConverter.ToLong(src[srcpos++], ref converter);
         dst[dstpos++] = (byte)(v >> 56);
         dst[dstpos++] = (byte)(v >> 48);
         dst[dstpos++] = (byte)(v >> 40);
         dst[dstpos++] = (byte)(v >> 32);
         dst[dstpos++] = (byte)(v >> 24);
         dst[dstpos++] = (byte)(v >> 16);
         dst[dstpos++] = (byte)(v >> 8);
         dst[dstpos++] = (byte)(v >> 0);
     }
 }
示例#2
0
文件: java.io.cs 项目: sreejukg/ikvm
 public static void bytesToDoubles(byte[] src, int srcpos, double[] dst, int dstpos, int ndoubles)
 {
     IKVM.Runtime.DoubleConverter converter = new IKVM.Runtime.DoubleConverter();
     for (int i = 0; i < ndoubles; i++)
     {
         long v = src[srcpos++];
         v             = (v << 8) | src[srcpos++];
         v             = (v << 8) | src[srcpos++];
         v             = (v << 8) | src[srcpos++];
         v             = (v << 8) | src[srcpos++];
         v             = (v << 8) | src[srcpos++];
         v             = (v << 8) | src[srcpos++];
         v             = (v << 8) | src[srcpos++];
         dst[dstpos++] = IKVM.Runtime.DoubleConverter.ToDouble(v, ref converter);
     }
 }
示例#3
0
 public static double ToDouble(long value, ref DoubleConverter converter)
 {
     converter.l = value;
     return(converter.d);
 }
示例#4
0
 public static long ToLong(double value, ref DoubleConverter converter)
 {
     converter.d = value;
     return(converter.l);
 }
示例#5
0
 public static double longBitsToDouble(long bits)
 {
     IKVM.Runtime.DoubleConverter converter = new IKVM.Runtime.DoubleConverter();
     return(IKVM.Runtime.DoubleConverter.ToDouble(bits, ref converter));
 }
示例#6
0
 public static long doubleToRawLongBits(double value)
 {
     IKVM.Runtime.DoubleConverter converter = new IKVM.Runtime.DoubleConverter();
     return(IKVM.Runtime.DoubleConverter.ToLong(value, ref converter));
 }