本文整理汇总了C#中NPOI.HSSF.Record.Record.Serialize方法的典型用法代码示例。如果您正苦于以下问题:C# Record.Serialize方法的具体用法?C# Record.Serialize怎么用?C# Record.Serialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPOI.HSSF.Record.Record
的用法示例。
在下文中一共展示了Record.Serialize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitRecord
public void VisitRecord(Record r)
{
int estimatedSize = r.RecordSize;
byte[] buf = new byte[estimatedSize];
int serializedSize = r.Serialize(0, buf);
if (estimatedSize != serializedSize)
{
throw new AssertionException("serialized size mismatch for record ("
+ r.GetType().Name + ")");
}
_totalSize += estimatedSize;
}
示例2: CompareData
private void CompareData(Record record, String message)
{
byte[] recData = record.Serialize();
for (int i = 0; i < recData.Length; i++)
{
Assert.AreEqual(recData[i], data[offset[0]++], message + " data byte " + i);
}
}
示例3: VisitRecord
public void VisitRecord(Record r)
{
int currentOffset = _startOffset + _countBytesWritten;
_countBytesWritten += r.Serialize(currentOffset, _data);
}
示例4: CompareRec
/**
* Compare the Serialized bytes of two records are equal
* @param first the first record to Compare
* @param second the second record to Compare
* @return boolean whether or not the record where equal
*/
private static bool CompareRec(Record first, Record second)
{
byte[] rec1 = first.Serialize();
byte[] rec2 = second.Serialize();
if (rec1.Length != rec2.Length)
{
return false;
}
for (int k = 0; k < rec1.Length; k++)
{
if (rec1[k] != rec2[k])
{
return false;
}
}
return true;
}