} // Read

        public static uint Read(this NativeReader reader, uint offset, out ConstantReferenceValueHandle handle)
        {
            uint value;
            offset = reader.DecodeUnsigned(offset, out value);
            handle = new ConstantReferenceValueHandle((int)value);
            handle._Validate();
            return offset;
        } // Read
        } // Read

        public static uint Read(this NativeReader reader, uint offset, out ConstantReferenceValueHandle[] values)
        {
            uint count;
            offset = reader.DecodeUnsigned(offset, out count);
            if (count == 0)
            {
                values = s_emptyConstantReferenceValueHandleArray;
            }
            else
            {
                values = new ConstantReferenceValueHandle[count];
                for (uint i = 0; i < count; ++i)
                {
                    ConstantReferenceValueHandle tmp;
                    offset = reader.Read(offset, out tmp);
                    values[i] = tmp;
                }
            }
            return offset;
        } // Read
        } // IsNull

        internal bool IsNull(ConstantReferenceValueHandle handle)
        {
            return (handle._value & 0x00FFFFFF) == 0;
        } // IsNull
        } // ToHandle

        internal Handle ToHandle(ConstantReferenceValueHandle handle)
        {
            return new Handle(handle._value);
        } // ToHandle
        } // GetConstantInt64Value

        public ConstantReferenceValue GetConstantReferenceValue(ConstantReferenceValueHandle handle)
        {
            var record = new ConstantReferenceValue() { _reader = this, _handle = handle };
            var offset = (uint)handle.Offset;
            return record;
        } // GetConstantReferenceValue
        } // Equals

        public bool Equals(ConstantReferenceValueHandle handle)
        {
            return _value == handle._value;
        } // Equals
Beispiel #7
0
        } // Read

        public static uint Read(this NativeReader reader, uint offset, out ConstantReferenceValueHandle[] values)
        {
            uint count;
            offset = reader.DecodeUnsigned(offset, out count);
            #if !NETFX_45
            if (count == 0)
            {
                values = Array.Empty<ConstantReferenceValueHandle>();
            }
            else
            #endif
            {
                values = new ConstantReferenceValueHandle[count];
                for (uint i = 0; i < count; ++i)
                {
                    ConstantReferenceValueHandle tmp;
                    offset = reader.Read(offset, out tmp);
                    values[i] = tmp;
                }
            }
            return offset;
        } // Read