示例#1
0
        /// <summary>
        /// Reads an object id tag from the stream
        /// </summary>
        /// <param name="tag">The tag number of the object id tag, or 255 for an application tag</param>
        /// <returns>The read value</returns>
        public ObjectId ReadObjectId(byte tag = 255)
        {
            _ensureTag(tag, ApplicationTag.ObjectId);
            _ensureLength(4);

            uint   val      = new Union4(_reader.ReadUInt32()).ReverseLE().UInt32;
            ushort type     = (ushort)(val >> 22);
            uint   instance = (val & 0x003FFFFF);

            return(new ObjectId(type, instance));
        }
示例#2
0
        /// <summary>
        /// Reads an object id tag from the stream
        /// </summary>
        /// <param name="tag">The tag number of the object id tag, or 255 for an application tag</param>
        /// <returns>The read value</returns>
        public ObjectId ReadObjectId(byte tag = 255)
        {
            _ensureTag(tag, ApplicationTag.ObjectId);
            _ensureLength(4);

            uint val = new Union4(_reader.ReadUInt32()).ReverseLE().UInt32;
            ushort type = (ushort)(val >> 22);
            uint instance = (val & 0x003FFFFF);
            return new ObjectId(type, instance);
        }