コード例 #1
0
        private void parseCommonTextStructureHeader()
        {
            /* In all observed text structures, I've seen the following common header. Until
             * I see one with a different format, I'll assume they all share this 10 byte header structure.
             * The status bits + fixed data length are common for all records, so the only special
             * fields in the header is the blob ID as well as the type. Note that byte 0 is offset from
             * the fixed data start, thus it'll be byte index 4 in the actual record.
             *
             * Byte		Content
             * 0-7		Small blob ID (long)
             * 8-9		Type (short)
             */

            BlobID = BitConverter.ToInt64(FixedLengthData, 0);
            short type = BitConverter.ToInt16(FixedLengthData, 8);

            if (Enum.IsDefined(typeof(LobStructureType), type))
            {
                LobType = (LobStructureType)type;
            }
            else
            {
                throw new ArgumentException("Invalid LOB record type encountered: " + type);
            }
        }
コード例 #2
0
ファイル: TextRecord.cs プロジェクト: Robin--/OrcaMDF
        private void parseCommonTextStructureHeader()
        {
            /* In all observed text structures, I've seen the following common header. Until
             * I see one with a different format, I'll assume they all share this 10 byte header structure.
             * The status bits + fixed data length are common for all records, so the only special
             * fields in the header is the blob ID as well as the type. Note that byte 0 is offset from
             * the fixed data start, thus it'll be byte index 4 in the actual record.
             *
             * Byte		Content
             * 0-7		Small blob ID (long)
             * 8-9		Type (short)
             */

            BlobID = BitConverter.ToInt64(FixedLengthData, 0);
            short type = BitConverter.ToInt16(FixedLengthData, 8);

            if(Enum.IsDefined(typeof(LobStructureType), type))
                LobType = (LobStructureType)type;
            else
                throw new ArgumentException("Invalid LOB record type encountered: " + type);
        }