Volante.Impl.Bytes.packF8 C# (CSharp) Method

packF8() public static method

public static packF8 ( byte arr, int offs, double val ) : void
arr byte
offs int
val double
return void
        public static void packF8(byte[] arr, int offs, double val)
        {
            pack8(arr, offs, BitConverter.DoubleToInt64Bits(val));
        }

Usage Example

Ejemplo n.º 1
0
        internal void pack(Page pg, int i)
        {
            byte[] dst = pg.data;
            switch (key.type)
            {
            case ClassDescriptor.FieldType.tpBoolean:
            case ClassDescriptor.FieldType.tpSByte:
            case ClassDescriptor.FieldType.tpByte:
                dst[OldBtreePage.firstKeyOffs + i] = (byte)key.ival;
                break;

            case ClassDescriptor.FieldType.tpShort:
            case ClassDescriptor.FieldType.tpUShort:
            case ClassDescriptor.FieldType.tpChar:
                Bytes.pack2(dst, OldBtreePage.firstKeyOffs + i * 2, (short)key.ival);
                break;

            case ClassDescriptor.FieldType.tpInt:
            case ClassDescriptor.FieldType.tpUInt:
            case ClassDescriptor.FieldType.tpEnum:
            case ClassDescriptor.FieldType.tpObject:
            case ClassDescriptor.FieldType.tpOid:
                Bytes.pack4(dst, OldBtreePage.firstKeyOffs + i * 4, key.ival);
                break;

            case ClassDescriptor.FieldType.tpLong:
            case ClassDescriptor.FieldType.tpULong:
            case ClassDescriptor.FieldType.tpDate:
                Bytes.pack8(dst, OldBtreePage.firstKeyOffs + i * 8, key.lval);
                break;

            case ClassDescriptor.FieldType.tpFloat:
                Bytes.packF4(dst, OldBtreePage.firstKeyOffs + i * 4, (float)key.dval);
                break;

            case ClassDescriptor.FieldType.tpDouble:
                Bytes.packF8(dst, OldBtreePage.firstKeyOffs + i * 8, key.dval);
                break;

            case ClassDescriptor.FieldType.tpDecimal:
                Bytes.packDecimal(dst, OldBtreePage.firstKeyOffs + i * 16, key.dec);
                break;

            case ClassDescriptor.FieldType.tpGuid:
                Bytes.packGuid(dst, OldBtreePage.firstKeyOffs + i * 16, key.guid);
                break;


            default:
                Debug.Assert(false, "Invalid type");
                break;
            }
            Bytes.pack4(dst, OldBtreePage.firstKeyOffs + (OldBtreePage.maxItems - i - 1) * 4, oid);
        }
All Usage Examples Of Volante.Impl.Bytes::packF8