} // Read

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

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

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

        internal Handle ToHandle(ConstantByteValueHandle handle)
        {
            return new Handle(handle._value);
        } // ToHandle
        } // GetConstantByteArray

        public ConstantByteValue GetConstantByteValue(ConstantByteValueHandle handle)
        {
            var record = new ConstantByteValue() { _reader = this, _handle = handle };
            var offset = (uint)handle.Offset;
            offset = _streamReader.Read(offset, out record._value);
            return record;
        } // GetConstantByteValue
        } // Equals

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

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