当前位置: 首页>>代码示例>>C#>>正文


C# RecordInputStream.ReadCompressedUnicode方法代码示例

本文整理汇总了C#中NPOI.HSSF.Record.RecordInputStream.ReadCompressedUnicode方法的典型用法代码示例。如果您正苦于以下问题:C# RecordInputStream.ReadCompressedUnicode方法的具体用法?C# RecordInputStream.ReadCompressedUnicode怎么用?C# RecordInputStream.ReadCompressedUnicode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NPOI.HSSF.Record.RecordInputStream的用法示例。


在下文中一共展示了RecordInputStream.ReadCompressedUnicode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LabelRecord

        /**
         * Constructs an Label record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public LabelRecord(RecordInputStream in1)
        {
            field_1_row = in1.ReadUShort();
            field_2_column = in1.ReadUShort();
            field_3_xf_index = in1.ReadShort();
            field_4_string_len = in1.ReadShort();
            field_5_unicode_flag = (byte)in1.ReadByte();
            if (field_4_string_len > 0)
            {
                if (IsUncompressedUnicode)
                {
                    field_6_value = in1.ReadUnicodeLEString(field_4_string_len);
                }
                else
                {
                    field_6_value = in1.ReadCompressedUnicode(field_4_string_len);
                }
            }
            else
            {
                field_6_value = "";
            }
            if (in1.Remaining > 0)
            {
                logger.Log(POILogger.INFO, "LabelRecord data remains: " +in1.Remaining +
                " : " + HexDump.ToHex(in1.ReadRemainder()));
            }
        }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:34,代码来源:LabelRecord.cs

示例2: FileSharingRecord

        /**
         * Constructs a FileSharing record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public FileSharingRecord(RecordInputStream in1)
        {
            field_1_Readonly = in1.ReadShort();
            field_2_password = in1.ReadShort();

            int nameLen = in1.ReadShort();

            if (nameLen > 0)
            {
                // TODO - Current examples(3) from junits only have zero Length username. 
                field_3_username_unicode_options = (byte)in1.ReadByte();
                field_3_username_value = in1.ReadCompressedUnicode(nameLen);
                
                if (field_3_username_value == null)
                {
                   // In some cases the user name can be null after reading from
                   // the input stream so we make sure this has a value
                   field_3_username_value = "";
                }
            }
            else
            {
                field_3_username_value = "";
            }
        }
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:30,代码来源:FileSharingRecord.cs

示例3: ViewFieldsRecord

        public ViewFieldsRecord(RecordInputStream in1)
        {
            sxaxis = in1.ReadShort();
            cSub = in1.ReadShort();
            grbitSub = in1.ReadShort();
            cItm = in1.ReadShort();

            int cchName = in1.ReadShort();
            if (cchName != STRING_NOT_PRESENT_LEN)
            {
                name = in1.ReadCompressedUnicode(cchName);
            }
        }
开发者ID:uwitec,项目名称:web-mvc-logistics,代码行数:13,代码来源:ViewFieldsRecord.cs

示例4: StringRecord

        /**
         * Constructs a String record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */
        public StringRecord(RecordInputStream in1)
        {
            int field_1_string_length = in1.ReadShort();
            _is16bitUnicode = in1.ReadByte() != 0x00;

            if (_is16bitUnicode)
            {
                _text = in1.ReadUnicodeLEString(field_1_string_length);
            }
            else
            {
                _text = in1.ReadCompressedUnicode(field_1_string_length);
            }
        }
开发者ID:ctddjyds,项目名称:npoi,代码行数:19,代码来源:StringRecord.cs

示例5: StringPtg

        /** Create a StringPtg from a stream */
        public StringPtg(RecordInputStream in1)
        {
            field_1_Length = in1.ReadUByte();
            field_2_options = (byte)in1.ReadByte();
            if (fHighByte.IsSet(field_2_options))
            {
                field_3_string = in1.ReadUnicodeLEString(field_1_Length);
            }
            else
            {
                field_3_string = in1.ReadCompressedUnicode(field_1_Length);
            }

            // SetValue(new String(data, offset+3, data[offset+1] + 256*data[offset+2]));
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:16,代码来源:StringPtg.cs

示例6: BoundSheetRecord

        /**
         * Constructs a BoundSheetRecord and Sets its fields appropriately
         *
         * @param in the RecordInputstream to Read the record from
         */
        public BoundSheetRecord(RecordInputStream in1)
        {
            field_1_position_of_BOF = in1.ReadInt();	// bof
            field_2_option_flags = in1.ReadShort();	// flags
            int field_3_sheetname_length = in1.ReadUByte();						// len(str)
            field_4_isMultibyteUnicode = (byte)in1.ReadByte();						// Unicode

            if (this.IsMultibyte)
            {
                field_5_sheetname = in1.ReadUnicodeLEString(field_3_sheetname_length);
            }
            else
            {
                field_5_sheetname = in1.ReadCompressedUnicode(field_3_sheetname_length);
            }
        }
开发者ID:babywzazy,项目名称:Server,代码行数:21,代码来源:BoundSheetRecord.cs

示例7: FormatRecord

        /**
         * Constructs a Format record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public FormatRecord(RecordInputStream in1)
        {
            field_1_index_code = in1.ReadShort();
            int field_3_unicode_len = in1.ReadShort();
            field_3_hasMultibyte = (in1.ReadByte() & (byte)0x01) != 0;

            if (field_3_hasMultibyte)
            {
                // Unicode
                field_4_formatstring = in1.ReadUnicodeLEString(field_3_unicode_len);
            }
            else
            {
                // not Unicode
                field_4_formatstring = in1.ReadCompressedUnicode(field_3_unicode_len);
            }
        }
开发者ID:ctddjyds,项目名称:npoi,代码行数:22,代码来源:FormatRecord.cs

示例8: ExternalNameRecord

        public ExternalNameRecord(RecordInputStream in1)
        {
            field_1_option_flag = in1.ReadShort();
            field_2_index = in1.ReadShort();
            field_3_not_used = in1.ReadShort();
            int nameLength = in1.ReadUByte();
            int multibyteFlag = in1.ReadUByte();
            if (multibyteFlag == 0)
            {
                field_4_name = in1.ReadCompressedUnicode(nameLength);
            }
            else
            {
                field_4_name = in1.ReadUnicodeLEString(nameLength);
            }            
            if (!HasFormula)
            {
                if (!IsStdDocumentNameIdentifier && !IsOLELink && IsAutomaticLink)
                {
                    // both need to be incremented
                    int nColumns = in1.ReadUByte() + 1;
                    int nRows = in1.ReadShort() + 1;

                    int totalCount = nRows * nColumns;
                    _ddeValues = ConstantValueParser.Parse(in1, totalCount);
                    _nColumns = nColumns;
                    _nRows = nRows;
                }

                if (in1.Remaining > 0)
                {
                    throw ReadFail("Some Unread data (is formula present?)");
                }
                field_5_name_definition = null;
                return;
            }
            int nBytesRemaining = in1.Available();
            if (in1.Remaining <= 0)
            {
                throw ReadFail("Ran out of record data trying to read formula.");
            }
            short formulaLen = in1.ReadShort();
            nBytesRemaining -= 2;
            field_5_name_definition = NPOI.SS.Formula.Formula.Read(formulaLen, in1, nBytesRemaining);
        }
开发者ID:uwitec,项目名称:web-mvc-logistics,代码行数:45,代码来源:ExternalNameRecord.cs

示例9: FileSharingRecord

        /**
         * Constructs a FileSharing record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public FileSharingRecord(RecordInputStream in1)
        {
            field_1_Readonly = in1.ReadShort();
            field_2_password = in1.ReadShort();

            int nameLen = in1.ReadShort();

            if (nameLen > 0)
            {
                // TODO - Current examples(3) from junits only have zero Length username. 
                field_3_username_unicode_options = (byte)in1.ReadByte();
                field_3_username_value = in1.ReadCompressedUnicode(nameLen);
            }
            else
            {
                field_3_username_value = "";
            }
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:23,代码来源:FileSharingRecord.cs

示例10: FooterRecord

        /// <summary>
        /// Initializes a new instance of the <see cref="FooterRecord"/> class.
        /// </summary>
        /// <param name="in1">the RecordInputstream to Read the record from</param>
        public FooterRecord(RecordInputStream in1)
        {
            if (in1.Remaining > 0)
            {
                field_1_footer_len = (byte)in1.ReadByte();
                /** These two fields are a bit odd. They are not documented*/
                field_2_reserved = (byte)in1.ReadByte();
                field_3_unicode_flag = (byte)in1.ReadByte();						// Unicode

                if (IsMultibyte)
                {
                    field_4_footer = in1.ReadUnicodeLEString(LittleEndian.UByteToInt(field_1_footer_len));
                }
                else
                {
                    field_4_footer = in1.ReadCompressedUnicode(LittleEndian.UByteToInt(field_1_footer_len));
                }
            }
        }
开发者ID:uwitec,项目名称:web-mvc-logistics,代码行数:23,代码来源:FooterRecord.cs

示例11: ViewFieldsRecord

        public ViewFieldsRecord(RecordInputStream in1)
        {
            sxaxis = in1.ReadShort();
            cSub = in1.ReadShort();
            grbitSub = in1.ReadShort();
            cItm = in1.ReadShort();

            int cchName = in1.ReadUShort();
            if (cchName != STRING_NOT_PRESENT_LEN)
            {
                int flag = in1.ReadByte();
                if ((flag & 0x01) != 0)
                {
                    _name = in1.ReadUnicodeLEString(cchName);
                }
                else
                {
                    _name = in1.ReadCompressedUnicode(cchName);
                }
            }
        }
开发者ID:89sos98,项目名称:npoi,代码行数:21,代码来源:ViewFieldsRecord.cs

示例12: LabelRecord

        /**
         * Constructs an Label record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public LabelRecord(RecordInputStream in1)
        {
            field_1_row = in1.ReadUShort();
            field_2_column = in1.ReadUShort();
            field_3_xf_index = in1.ReadShort();
            field_4_string_len = in1.ReadShort();
            field_5_unicode_flag = (byte)in1.ReadByte();
            if (field_4_string_len > 0)
            {
                if (IsUnCompressedUnicode)
                {
                    field_6_value = in1.ReadUnicodeLEString(field_4_string_len);
                }
                else
                {
                    field_6_value = in1.ReadCompressedUnicode(field_4_string_len);
                }
            }
            else
            {
                field_6_value = "";
            }
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:29,代码来源:LabelRecord.cs

示例13: HeaderFooterBase

        protected HeaderFooterBase(RecordInputStream in1)
        {
            if (in1.Remaining > 0)
            {
                int field_1_footer_len = in1.ReadShort();
                field_2_hasMultibyte = in1.ReadByte() != 0x00;

                if (field_2_hasMultibyte)
                {
                    field_3_text = in1.ReadUnicodeLEString(field_1_footer_len);
                }
                else
                {
                    field_3_text = in1.ReadCompressedUnicode(field_1_footer_len);
                }
            }
            else
            {
                // Note - this is unusual for BIFF records in general, but normal for header / footer records:
                // when the text is empty string, the whole record is empty (just the 4 byte BIFF header)
                field_3_text = "";
            }
        }
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:23,代码来源:HeaderFooterBase.cs

示例14: ExternalNameRecord

        private Ptg[] field_5_name_definition; // TODO - junits for name definition field

        public ExternalNameRecord(RecordInputStream in1)
        {
            field_1_option_flag = in1.ReadShort();
            field_2_index = in1.ReadShort();
            field_3_not_used = in1.ReadShort();
            short nameLength = in1.ReadShort();
            field_4_name = in1.ReadCompressedUnicode(nameLength);
            if (!HasFormula)
            {
                if (in1.Remaining > 0)
                {
                    throw ReadFail("Some UnRead data (is formula present?)");
                }
                field_5_name_definition = EMPTY_PTG_ARRAY;
                return;
            }
            if (in1.Remaining <= 0)
            {
                throw ReadFail("Ran out of record data trying to Read formula.");
            }
            short formulaLen = in1.ReadShort();
            field_5_name_definition = Ptg.ReadTokens(formulaLen, in1);

        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:26,代码来源:ExternalNameRecord.cs

示例15: EmbeddedObjectRefSubRecord

        /**
         * Constructs an EmbeddedObjectRef record and Sets its fields appropriately.
         *
         * @param in the record input stream.
         */
        public EmbeddedObjectRefSubRecord(RecordInputStream in1)
        {
            // Much guess-work going on here due to lack of any documentation.
            // See similar source code in OOO:
            // http://lxr.go-oo.org/source/sc/sc/source/filter/excel/xiescher.cxx
            // 1223 void XclImpOleObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nRecSize )

            int streamIdOffset = in1.ReadShort(); // OOO calls this 'nFmlaLen'

            int dataLenAfterFormula = in1.Remaining - streamIdOffset;
            int formulaSize = in1.ReadUShort();

            field_1_unknown_int = in1.ReadInt();
            byte[] formulaRawBytes = ReadRawData(in1, formulaSize);
            field_2_refPtg = ReadRefPtg(formulaRawBytes);
            if (field_2_refPtg == null)
            {
                // common case
                // field_2_n16 seems to be 5 here
                // The formula almost looks like tTbl but the row/column values seem like garbage.
                field_2_unknownFormulaData = formulaRawBytes;
            }
            else
            {
                field_2_unknownFormulaData = null;
            }


            int stringByteCount;
            if (in1.Remaining >= dataLenAfterFormula + 3)
            {
                int tag = in1.ReadByte();
                if (tag != 0x03)
                {
                    throw new RecordFormatException("Expected byte 0x03 here");
                }
                int nChars = in1.ReadUShort();
                if (nChars > 0)
                {
                    // OOO: the 4th way Xcl stores a unicode string: not even a Grbit byte present if Length 0
                    field_3_unicode_flag = (in1.ReadByte() & 0x01) != 0;
                    if (field_3_unicode_flag)
                    {
                        field_4_ole_classname = in1.ReadUnicodeLEString(nChars);
                        stringByteCount = nChars * 2;
                    }
                    else
                    {
                        field_4_ole_classname = in1.ReadCompressedUnicode(nChars);
                        stringByteCount = nChars;
                    }
                }
                else
                {
                    field_4_ole_classname = "";
                    stringByteCount = 0;
                }
            }
            else
            {
                field_4_ole_classname = null;
                stringByteCount = 0;
            }
            // Pad to next 2-byte boundary
            if (((stringByteCount + formulaSize) % 2) != 0)
            {
                int b = in1.ReadByte();
                if (field_2_refPtg != null && field_4_ole_classname == null)
                {
                    field_4_unknownByte = (byte)b;
                }
            }
            int nUnexpectedPadding = in1.Remaining - dataLenAfterFormula;

            if (nUnexpectedPadding > 0)
            {
                Console.WriteLine("Discarding " + nUnexpectedPadding + " unexpected padding bytes ");
                ReadRawData(in1, nUnexpectedPadding);
            }

            // Fetch the stream ID
            if (dataLenAfterFormula >= 4)
            {
                field_5_stream_id = in1.ReadInt();
            }
            else
            {
                field_5_stream_id = null;
            }

            field_6_unknown = in1.ReadRemainder();
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:97,代码来源:EmbeddedObjectRefSubRecord.cs


注:本文中的NPOI.HSSF.Record.RecordInputStream.ReadCompressedUnicode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。