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


C# ILittleEndianInput类代码示例

本文整理汇总了C#中ILittleEndianInput的典型用法代码示例。如果您正苦于以下问题:C# ILittleEndianInput类的具体用法?C# ILittleEndianInput怎么用?C# ILittleEndianInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ReadTokens

 /**
  * Reads <c>size</c> bytes of the input stream, to Create an array of <c>Ptg</c>s.
  * Extra data (beyond <c>size</c>) may be Read if and <c>ArrayPtg</c>s are present.
  */
 public static Ptg[] ReadTokens(int size, ILittleEndianInput in1)
 {
     ArrayList temp = new ArrayList(4 + size / 2);
     int pos = 0;
     bool hasArrayPtgs = false;
     while (pos < size)
     {
         Ptg ptg = Ptg.CreatePtg(in1);
         if (ptg is ArrayPtg.Initial)
         {
             hasArrayPtgs = true;
         }
         pos += ptg.Size;
         temp.Add(ptg);
     }
     if (pos != size)
     {
         throw new Exception("Ptg array size mismatch");
     }
     if (hasArrayPtgs)
     {
         Ptg[] result = ToPtgArray(temp);
         for (int i = 0; i < result.Length; i++)
         {
             if (result[i] is ArrayPtg.Initial)
             {
                 result[i] = ((ArrayPtg.Initial)result[i]).FinishReading(in1);
             }
         }
         return result;
     }
     return ToPtgArray(temp);
 }
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:37,代码来源:Ptg.cs

示例2: CreateSubRecord

        public static SubRecord CreateSubRecord(ILittleEndianInput in1, CommonObjectType cmoOt)
        {
            int sid = in1.ReadUShort();
            int secondUShort = in1.ReadUShort(); // Often (but not always) the datasize for the sub-record


            switch (sid)
            {
                case CommonObjectDataSubRecord.sid:
                    return new CommonObjectDataSubRecord(in1, secondUShort);
                case EmbeddedObjectRefSubRecord.sid:
                    return new EmbeddedObjectRefSubRecord(in1, secondUShort);
                case GroupMarkerSubRecord.sid:
                    return new GroupMarkerSubRecord(in1, secondUShort);
                case EndSubRecord.sid:
                    return new EndSubRecord(in1, secondUShort);
                case NoteStructureSubRecord.sid:
                    return new NoteStructureSubRecord(in1, secondUShort);
                case LbsDataSubRecord.sid:
                    return new LbsDataSubRecord(in1, secondUShort, (int)cmoOt);
                case FtCblsSubRecord.sid:
                    return new FtCblsSubRecord(in1, secondUShort);
            }
            return new UnknownSubRecord(in1, sid, secondUShort);
        }
开发者ID:ctddjyds,项目名称:npoi,代码行数:25,代码来源:SubRecord.cs

示例3: EndSubRecord

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

        public EndSubRecord(ILittleEndianInput in1, int size)
        {
            if ((size & 0xFF) != ENCODED_SIZE)
            { // mask out random crap in upper byte
                throw new RecordFormatException("Unexpected size (" + size + ")");
            }

        }
开发者ID:ctddjyds,项目名称:npoi,代码行数:14,代码来源:EndSubRecord.cs

示例4: FtCfSubRecord

 public FtCfSubRecord(ILittleEndianInput in1, int size)
 {
     if (size != length)
     {
         throw new RecordFormatException("Unexpected size (" + size + ")");
     }
     flags = in1.ReadShort();
 }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:8,代码来源:FtCfSubRecord.cs

示例5: Parse

 public static object[] Parse(ILittleEndianInput in1, int nValues)
 {
     object[] result = new Object[nValues];
     for (int i = 0; i < result.Length; i++)
     {
         result[i]=ReadAConstantValue(in1);
     }
     return result;
 }
开发者ID:xoposhiy,项目名称:npoi,代码行数:9,代码来源:ConstantValueParser.cs

示例6: NoteStructureSubRecord

 /**
  * Constructs a NoteStructureSubRecord and Sets its fields appropriately.
  *
  */
 public NoteStructureSubRecord(ILittleEndianInput in1, int size)
 {
     if (size != ENCODED_SIZE) {
         throw new RecordFormatException("Unexpected size (" + size + ")");
     }
     //just grab the raw data
     byte[] buf = new byte[size];
     in1.ReadFully(buf);
     reserved = buf;
 }
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:14,代码来源:NoteStructureSubRecord.cs

示例7: ReadBoolean

 private static Object ReadBoolean(ILittleEndianInput in1)
 {
     byte val = (byte)in1.ReadLong(); // 7 bytes 'not used'
     switch (val)
     {
         case FALSE_ENCODING:
             return false;
         case TRUE_ENCODING:
             return true;
     }
     // Don't tolerate Unusual bool encoded values (unless it becomes evident that they occur)
     throw new Exception("unexpected bool encoding (" + val + ")");
 }
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:13,代码来源:ConstantValueParser.cs

示例8: StringPtg

        /** Create a StringPtg from a stream */
        public StringPtg(ILittleEndianInput in1)
        {
            int field_1_length = in1.ReadUByte();
			field_2_options = (byte)in1.ReadByte();
            _is16bitUnicode = (field_2_options & 0x01) != 0;
            if (_is16bitUnicode)
            {
                field_3_string = StringUtil.ReadUnicodeLE(in1, field_1_length);
            }
            else
            {
                field_3_string = StringUtil.ReadCompressedUnicode(in1, field_1_length);
            }
        }
开发者ID:Johnnyfly,项目名称:source20131023,代码行数:15,代码来源:StringPtg.cs

示例9: Biff8DecryptingStream

        public Biff8DecryptingStream(Stream in1, int InitialOffSet, Biff8EncryptionKey key)
        {
            _rc4 = new Biff8RC4(InitialOffSet, key);

            if (in1 is ILittleEndianInput)
            {
                // accessing directly is an optimisation
                _le = (ILittleEndianInput)in1;
            }
            else
            {
                // less optimal, but should work OK just the same. Often occurs in junit tests.
                _le = new LittleEndianInputStream(in1);
            }
        }
开发者ID:Johnnyfly,项目名称:source20131023,代码行数:15,代码来源:Biff8DecryptingStream.cs

示例10: ScrollableObjectSubRecord

 public ScrollableObjectSubRecord(ILittleEndianInput in1, int size)
 {
     if (size !=this.DataSize)
     {
         throw new RecordFormatException(string.Format(CultureInfo.CurrentCulture, "Expected size {0} but got ({1})", this.DataSize, size));
     }
     in1.ReadInt();
     field_1_iVal=in1.ReadShort();
     field_2_iMin=in1.ReadShort();
     field_3_iMax=in1.ReadShort();
     field_4_dInc=in1.ReadShort();
     field_5_dPage=in1.ReadShort();
     field_6_fHoriz = in1.ReadShort();
     field_7_dxScroll = in1.ReadShort();
     field_8_options = in1.ReadShort();
 }
开发者ID:missxiaohuang,项目名称:Weekly,代码行数:16,代码来源:ScrollableObjectSubRecord.cs

示例11: AttrPtg

        public AttrPtg(ILittleEndianInput in1)
        {
            field_1_options =(byte)in1.ReadByte();
            field_2_data = in1.ReadShort();
            if (IsOptimizedChoose)
            {
                int nCases = field_2_data;
                int[] jumpTable = new int[nCases];
                for (int i = 0; i < jumpTable.Length; i++)
                {
                    jumpTable[i] = in1.ReadUShort();
                }
                _jumpTable = jumpTable;
                _chooseFuncOffset = in1.ReadUShort();
            }
            else
            {
                _jumpTable = null;
                _chooseFuncOffset = -1;
            }

        }
开发者ID:89sos98,项目名称:npoi,代码行数:22,代码来源:AttrPtg.cs

示例12: ReadAConstantValue

 private static object ReadAConstantValue(ILittleEndianInput in1)
 {
     byte grbit = (byte)in1.ReadByte();
     switch (grbit)
     {
         case TYPE_EMPTY:
             in1.ReadLong(); // 8 byte 'not used' field
             return EMPTY_REPRESENTATION;
         case TYPE_NUMBER:
             return in1.ReadDouble();
         case TYPE_STRING:
             return StringUtil.ReadUnicodeString(in1);
         case TYPE_BOOLEAN:
             return ReadBoolean(in1);
         case TYPE_ERROR_CODE:
             int errCode = in1.ReadUShort();
             // next 6 bytes are Unused
             in1.ReadUShort();
             in1.ReadInt();
             return ErrorConstant.ValueOf(errCode);
     }
     throw new Exception("Unknown grbit value (" + grbit + ")");
 }
开发者ID:xoposhiy,项目名称:npoi,代码行数:23,代码来源:ConstantValueParser.cs

示例13: MemAreaPtg

 public MemAreaPtg(ILittleEndianInput in1)
 {
     field_1_reserved = in1.ReadInt();
     field_2_subex_len = in1.ReadShort();
 }
开发者ID:xoposhiy,项目名称:npoi,代码行数:5,代码来源:MemAreaPtg.cs

示例14: GUID

		public GUID(ILittleEndianInput in1) 
            :this(in1.ReadInt(), in1.ReadUShort(), in1.ReadUShort(), in1.ReadLong())
        {
			
		}
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:5,代码来源:GUID.cs

示例15: NameXPtg

        public NameXPtg(ILittleEndianInput in1)
            :this(in1.ReadUShort(), in1.ReadUShort(), in1.ReadUShort())
        {

        }
开发者ID:newlysoft,项目名称:npoi,代码行数:5,代码来源:NameXPtg.cs


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