本文整理汇总了C#中Zephyr.Utils.NPOI.HSSF.Record.RecordInputStream.ReadUShort方法的典型用法代码示例。如果您正苦于以下问题:C# RecordInputStream.ReadUShort方法的具体用法?C# RecordInputStream.ReadUShort怎么用?C# RecordInputStream.ReadUShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zephyr.Utils.NPOI.HSSF.Record.RecordInputStream
的用法示例。
在下文中一共展示了RecordInputStream.ReadUShort方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExtendedPivotTableViewFieldsRecord
public ExtendedPivotTableViewFieldsRecord(RecordInputStream in1)
{
grbit1 = in1.ReadInt();
grbit2 = in1.ReadUByte();
citmShow = in1.ReadUByte();
isxdiSort = in1.ReadUShort();
isxdiShow = in1.ReadUShort();
// This record seems to have different valid encodings
switch (in1.Remaining) {
case 0:
// as per "Microsoft Excel Developer's Kit" book
// older version of SXVDEX - doesn't seem to have a sub-total name
reserved1 = 0;
reserved2 = 0;
subName = null;
return;
case 10:
// as per "MICROSOFT OFFICE EXCEL 97-2007 BINARY FILE FORMAT SPECIFICATION" pdf
break;
default:
throw new RecordFormatException("Unexpected remaining size (" + in1.Remaining + ")");
}
int cchSubName = in1.ReadUShort();
reserved1 = in1.ReadInt();
reserved2 = in1.ReadInt();
if (cchSubName != STRING_NOT_PRESENT_LEN)
{
subName = in1.ReadUnicodeLEString(cchSubName);
}
}
示例2: ArrayRecord
public ArrayRecord(RecordInputStream in1)
: base(in1)
{
_options = in1.ReadUShort();
_field3notUsed = in1.ReadInt();
int formulaTokenLen = in1.ReadUShort();
int totalFormulaLen = in1.Available();
_formula = Zephyr.Utils.NPOI.SS.Formula.Formula.Read(formulaTokenLen, in1, totalFormulaLen);
}
示例3: TableStylesRecord
public TableStylesRecord(RecordInputStream in1)
{
rt = in1.ReadUShort();
grbitFrt = in1.ReadUShort();
in1.ReadFully(unused);
cts = in1.ReadInt();
int cchDefListStyle = in1.ReadUShort();
int cchDefPivotStyle = in1.ReadUShort();
rgchDefListStyle = in1.ReadUnicodeLEString(cchDefListStyle);
rgchDefPivotStyle = in1.ReadUnicodeLEString(cchDefPivotStyle);
}
示例4: SelectionRecord
/// <summary>
/// Constructs a Selection record and Sets its fields appropriately.
/// </summary>
/// <param name="in1">the RecordInputstream to Read the record from</param>
public SelectionRecord(RecordInputStream in1)
{
field_1_pane = (byte)in1.ReadByte();
field_2_row_active_cell = in1.ReadUShort();
field_3_col_active_cell = in1.ReadShort();
field_4_ref_active_cell = in1.ReadShort();
int field_5_num_refs = in1.ReadUShort();
field_6_refs = new CellRangeAddress8Bit[field_5_num_refs];
for (int i = 0; i < field_5_num_refs; i++)
{
field_6_refs[i] = new CellRangeAddress8Bit(in1);
}
}
示例5: FeatRecord
public FeatRecord(RecordInputStream in1)
{
futureHeader = new FtrHeader(in1);
isf_sharedFeatureType = in1.ReadShort();
reserved1 = (byte)in1.ReadByte();
reserved2 = in1.ReadInt();
int cref = in1.ReadUShort();
cbFeatData = in1.ReadInt();
reserved3 = in1.ReadShort();
cellRefs = new CellRangeAddress[cref];
for (int i = 0; i < cellRefs.Length; i++)
{
cellRefs[i] = new CellRangeAddress(in1);
}
switch (isf_sharedFeatureType)
{
case FeatHdrRecord.SHAREDFEATURES_ISFPROTECTION:
sharedFeature = new FeatProtection(in1);
break;
case FeatHdrRecord.SHAREDFEATURES_ISFFEC2:
sharedFeature = new FeatFormulaErr2(in1);
break;
case FeatHdrRecord.SHAREDFEATURES_ISFFACTOID:
sharedFeature = new FeatSmartTag(in1);
break;
default:
System.Console.WriteLine("Unknown Shared Feature " + isf_sharedFeatureType + " found!");
break;
}
}
示例6: MulBlankRecord
/**
* Constructs a MulBlank record and Sets its fields appropriately.
*
* @param in the RecordInputstream to Read the record from
*/
public MulBlankRecord(RecordInputStream in1)
{
_row = in1.ReadUShort();
_first_col = in1.ReadShort();
_xfs = ParseXFs(in1);
_last_col = in1.ReadShort();
}
示例7: BoolErrRecord
/**
* Constructs a BoolErr record and Sets its fields appropriately.
*
* @param in the RecordInputstream to Read the record from
*/
public BoolErrRecord(RecordInputStream in1)
: base(in1)
{
switch (in1.Remaining)
{
case 2:
_value = in1.ReadByte();
break;
case 3:
_value = in1.ReadUShort();
break;
default:
throw new RecordFormatException("Unexpected size ("
+ in1.Remaining + ") for BOOLERR record.");
}
int flag = in1.ReadUByte();
switch (flag)
{
case 0:
_isError = false;
break;
case 1:
_isError = true;
break;
default:
throw new RecordFormatException("Unexpected isError flag ("
+ flag + ") for BOOLERR record.");
}
}
示例8: MulRKRecord
/**
* Constructs a MulRK record and Sets its fields appropriately.
*
* @param in the RecordInputstream to Read the record from
*/
public MulRKRecord(RecordInputStream in1)
{
field_1_row = in1.ReadUShort();
field_2_first_col = in1.ReadShort();
field_3_rks = RkRec.ParseRKs(in1);
field_4_last_col = in1.ReadShort();
}
示例9: NoteRecord
/**
* Constructs a <c>NoteRecord</c> and Fills its fields
* from the supplied <c>RecordInputStream</c>.
*
* @param in the stream to Read from
*/
public NoteRecord(RecordInputStream in1)
{
field_1_row = in1.ReadShort();
field_2_col = in1.ReadUShort();
field_3_flags = in1.ReadShort();
field_4_shapeid = in1.ReadUShort();
int length = in1.ReadShort();
field_5_hasMultibyte = in1.ReadByte() != 0x00;
if (field_5_hasMultibyte) {
field_6_author = StringUtil.ReadUnicodeLE(in1, length);
} else {
field_6_author = StringUtil.ReadCompressedUnicode(in1, length);
}
if (in1.Available() == 1) {
field_7_padding = (byte)in1.ReadByte();
}
}
示例10: ReadUShortAndCheck
private static int ReadUShortAndCheck(RecordInputStream in1)
{
if (in1.Remaining < ENCODED_SIZE)
{
// Ran out of data
throw new Exception("Ran out of data reading CellRangeAddress");
}
return in1.ReadUShort();
}
示例11: CellRangeAddressList
/**
* @param in the RecordInputstream to read the record from
*/
public CellRangeAddressList(RecordInputStream in1)
{
int nItems = in1.ReadUShort();
_list = new ArrayList(nItems);
for (int k = 0; k < nItems; k++)
{
_list.Add(new CellRangeAddress(in1));
}
}
示例12: DBCellRecord
/**
* Constructs a DBCellRecord and Sets its fields appropriately
* @param in the RecordInputstream to Read the record from
*/
public DBCellRecord(RecordInputStream in1)
{
field_1_row_offset = in1.ReadUShort();
int size = in1.Remaining;
field_2_cell_offsets = new short[size / 2];
for (int i = 0; i < field_2_cell_offsets.Length; i++)
{
field_2_cell_offsets[i] = in1.ReadShort();
}
}
示例13: MergeCellsRecord
/**
* Constructs a MergedCellsRecord and Sets its fields appropriately
* @param in the RecordInputstream to Read the record from
*/
public MergeCellsRecord(RecordInputStream in1)
{
int nRegions = in1.ReadUShort();
CellRangeAddress[] cras = new CellRangeAddress[nRegions];
for (int i = 0; i < nRegions; i++)
{
cras[i] = new CellRangeAddress(in1);
}
_numberOfRegions = nRegions;
_startIndex = 0;
_regions = cras;
}
示例14: ColumnInfoRecord
/**
* Constructs a ColumnInfo record and Sets its fields appropriately
* @param in the RecordInputstream to Read the record from
*/
public ColumnInfoRecord(RecordInputStream in1)
{
_first_col = in1.ReadUShort();
_last_col = in1.ReadUShort();
_col_width = in1.ReadUShort();
_xf_index = in1.ReadUShort();
_options = in1.ReadUShort();
switch (in1.Remaining)
{
case 2: // usual case
field_6_reserved = in1.ReadUShort();
break;
case 1:
// often COLINFO Gets encoded 1 byte short
// shouldn't matter because this field Is Unused
field_6_reserved = in1.ReadByte();
break;
case 0:
// According to bugzilla 48332,
// "SoftArtisans OfficeWriter for Excel" totally skips field 6
// Excel seems to be OK with this, and assumes zero.
field_6_reserved = 0;
break;
default:
throw new Exception("Unusual record size remaining=(" + in1.Remaining + ")");
}
}
示例15: WriteAccessRecord
/**
* Constructs a WriteAccess record and Sets its fields appropriately.
* @param in the RecordInputstream to Read the record from
*/
public WriteAccessRecord(RecordInputStream in1)
{
if (in1.Remaining > DATA_SIZE)
{
throw new RecordFormatException("Expected data size (" + DATA_SIZE + ") but got ("
+ in1.Remaining + ")");
}
// The string is always 112 characters (padded with spaces), therefore
// this record can not be continued.
int nChars = in1.ReadUShort();
int is16BitFlag = in1.ReadUByte();
if (nChars > DATA_SIZE || (is16BitFlag & 0xFE) != 0)
{
// String header looks wrong (probably missing)
// OOO doc says this is optional anyway.
// reconstruct data
byte[] data = new byte[3 + in1.Remaining];
LittleEndian.PutUShort(data, 0, nChars);
LittleEndian.PutByte(data, 2, is16BitFlag);
in1.ReadFully(data, 3, data.Length - 3);
char[] data1=new char[data.Length];
for (int i = 0; i < data.Length; i++)
{
data1[i] = (char)data[i];
}
String rawValue = new String(data1);
Username = rawValue.Trim();
return;
}
String rawText;
if ((is16BitFlag & 0x01) == 0x00)
{
rawText = StringUtil.ReadCompressedUnicode(in1, nChars);
}
else
{
rawText = StringUtil.ReadUnicodeLE(in1, nChars);
}
field_1_username = rawText.Trim();
// consume padding
int padSize = in1.Remaining;
while (padSize > 0)
{
// in some cases this seems to be garbage (non spaces)
in1.ReadUByte();
padSize--;
}
}