本文整理汇总了C#中ILittleEndianInput.ReadShort方法的典型用法代码示例。如果您正苦于以下问题:C# ILittleEndianInput.ReadShort方法的具体用法?C# ILittleEndianInput.ReadShort怎么用?C# ILittleEndianInput.ReadShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILittleEndianInput
的用法示例。
在下文中一共展示了ILittleEndianInput.ReadShort方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FtCfSubRecord
public FtCfSubRecord(ILittleEndianInput in1, int size)
{
if (size != length)
{
throw new RecordFormatException("Unexpected size (" + size + ")");
}
flags = in1.ReadShort();
}
示例2: 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();
}
示例3: 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;
}
}
示例4: ExpPtg
public ExpPtg(ILittleEndianInput in1)
{
field_1_first_row = in1.ReadShort();
field_2_first_col = in1.ReadShort();
}
示例5: MemAreaPtg
public MemAreaPtg(ILittleEndianInput in1)
{
field_1_reserved = in1.ReadInt();
field_2_subex_len = in1.ReadShort();
}
示例6: EmbeddedObjectRefSubRecord
/**
* Constructs an EmbeddedObjectRef record and Sets its fields appropriately.
*
* @param in the record input stream.
*/
public EmbeddedObjectRefSubRecord(ILittleEndianInput in1, int size)
{
// 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 remaining = size - LittleEndianConsts.SHORT_SIZE;
int dataLenAfterFormula = remaining - streamIdOffset;
int formulaSize = in1.ReadUShort();
remaining -= LittleEndianConsts.SHORT_SIZE;
field_1_unknown_int = in1.ReadInt();
remaining -= LittleEndianConsts.INT_SIZE;
byte[] formulaRawBytes = ReadRawData(in1, formulaSize);
remaining -= 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 (remaining >= dataLenAfterFormula + 3)
{
int tag = in1.ReadByte();
stringByteCount = LittleEndianConsts.BYTE_SIZE;
if (tag != 0x03)
{
throw new RecordFormatException("Expected byte 0x03 here");
}
int nChars = in1.ReadUShort();
stringByteCount += LittleEndianConsts.SHORT_SIZE;
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;
stringByteCount += LittleEndianConsts.BYTE_SIZE;
if (field_3_unicode_flag)
{
field_4_ole_classname = StringUtil.ReadUnicodeLE(in1,nChars);
stringByteCount += nChars * 2;
}
else
{
field_4_ole_classname = StringUtil.ReadCompressedUnicode(in1,nChars);
stringByteCount += nChars;
}
}
else
{
field_4_ole_classname = "";
}
}
else
{
field_4_ole_classname = null;
stringByteCount = 0;
}
remaining -= stringByteCount;
// Pad to next 2-byte boundary
if (((stringByteCount + formulaSize) % 2) != 0)
{
int b = in1.ReadByte();
remaining -= LittleEndianConsts.BYTE_SIZE;
if (field_2_refPtg != null && field_4_ole_classname == null)
{
field_4_unknownByte = (byte)b;
}
}
int nUnexpectedPadding = remaining - dataLenAfterFormula;
if (nUnexpectedPadding > 0)
{
logger.Log(POILogger.ERROR, "Discarding " + nUnexpectedPadding + " unexpected padding bytes ");
ReadRawData(in1, nUnexpectedPadding);
remaining -= nUnexpectedPadding;
}
// Fetch the stream ID
if (dataLenAfterFormula >= 4)
{
field_5_stream_id = in1.ReadInt();
remaining -= LittleEndianConsts.INT_SIZE;
}
//.........这里部分代码省略.........
示例7: FinishReading
/**
* Read in the actual token (array) values. This occurs
* AFTER the last Ptg in the expression.
* See page 304-305 of Excel97-2007BinaryFileFormat(xls)Specification.pdf
*/
public ArrayPtg FinishReading(ILittleEndianInput in1)
{
int nColumns = in1.ReadUByte();
short nRows = in1.ReadShort();
//The token_1_columns and token_2_rows do not follow the documentation.
//The number of physical rows and columns is actually +1 of these values.
//Which is not explicitly documented.
nColumns++;
nRows++;
int totalCount = nRows * nColumns;
Object[] arrayValues = ConstantValueParser.Parse(in1, totalCount);
ArrayPtg result = new ArrayPtg(_reserved0, _reserved1, _reserved2, nColumns, nRows, arrayValues);
result.PtgClass = this.PtgClass;
return result;
}
示例8: NamePtg
/** Creates new NamePtg */
public NamePtg(ILittleEndianInput in1)
{
field_1_label_index = in1.ReadShort();
field_2_zero = in1.ReadShort();
}
示例9: Create
/**Creates new function pointer from a byte array
* usually called while reading an excel file.
*/
public static FuncVarPtg Create(ILittleEndianInput in1) {
return Create(in1.ReadByte(), in1.ReadShort());
}
示例10: Area3DPtg
public Area3DPtg(ILittleEndianInput in1)
{
field_1_index_extern_sheet = in1.ReadShort();
ReadCoordinates(in1);
}
示例11: CommonObjectDataSubRecord
/**
* Constructs a CommonObjectData record and Sets its fields appropriately.
*
* @param in the RecordInputstream to Read the record from
*/
public CommonObjectDataSubRecord(ILittleEndianInput in1, int size)
{
if (size != 18)
{
throw new RecordFormatException("Expected size 18 but got (" + size + ")");
}
field_1_objectType = in1.ReadShort();
field_2_objectId = in1.ReadUShort();
field_3_option = in1.ReadShort();
field_4_reserved1 = in1.ReadInt();
field_5_reserved2 = in1.ReadInt();
field_6_reserved3 = in1.ReadInt();
}