本文整理汇总了C#中Zephyr.Utils.NPOI.HSSF.Record.RecordInputStream.NextRecord方法的典型用法代码示例。如果您正苦于以下问题:C# RecordInputStream.NextRecord方法的具体用法?C# RecordInputStream.NextRecord怎么用?C# RecordInputStream.NextRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zephyr.Utils.NPOI.HSSF.Record.RecordInputStream
的用法示例。
在下文中一共展示了RecordInputStream.NextRecord方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StreamEncryptionInfo
public StreamEncryptionInfo(RecordInputStream rs, List<Record> outputRecs)
{
Record rec;
rs.NextRecord();
int recSize = 4 + rs.Remaining;
rec = RecordFactory.CreateSingleRecord(rs);
outputRecs.Add(rec);
FilePassRecord fpr = null;
if (rec is BOFRecord)
{
_hasBOFRecord = true;
if (rs.HasNextRecord)
{
rs.NextRecord();
rec = RecordFactory.CreateSingleRecord(rs);
recSize += rec.RecordSize;
outputRecs.Add(rec);
if (rec is FilePassRecord)
{
fpr = (FilePassRecord)rec;
outputRecs.RemoveAt(outputRecs.Count - 1);
// TODO - add fpr not Added to outPutRecs
rec = outputRecs[0];
}
else
{
// workbook not encrypted (typical case)
if (rec is EOFRecord)
{
// A workbook stream is never empty, so crash instead
// of trying to keep track of nesting level
throw new InvalidOperationException("Nothing between BOF and EOF");
}
}
}
}
else
{
// Invalid in a normal workbook stream.
// However, some test cases work on sub-sections of
// the workbook stream that do not begin with BOF
_hasBOFRecord = false;
}
_InitialRecordsSize = recSize;
_filePassRec = fpr;
_lastRecord = rec;
}
示例2: ConvertToInputStream
private static RecordInputStream ConvertToInputStream(DrawingRecord r)
{
byte[] data = r.Serialize();
using (MemoryStream ms = new MemoryStream(data))
{
RecordInputStream rinp = new RecordInputStream(ms);
rinp.NextRecord();
return rinp;
}
}
示例3: ExtSSTRecord
/**
* Constructs a EOFRecord record and Sets its fields appropriately.
* @param in the RecordInputstream to Read the record from
*/
public ExtSSTRecord(RecordInputStream in1)
{
field_1_strings_per_bucket = in1.ReadShort();
int nInfos = in1.Remaining / InfoSubRecord.ENCODED_SIZE;
List<InfoSubRecord> lst = new List<InfoSubRecord>(nInfos);
while (in1.Available() > 0)
{
InfoSubRecord info = new InfoSubRecord(in1);
lst.Add(info);
if (in1.Available() == 0 && in1.HasNextRecord && in1.GetNextSid() == ContinueRecord.sid)
{
in1.NextRecord();
}
}
_sstInfos = lst.ToArray();
}
示例4: CloneViaReserialise
public Record CloneViaReserialise()
{
// Do it via a re-serialization
// It's a cheat, but it works...
byte[] b = Serialize();
using (MemoryStream ms = new MemoryStream(b))
{
RecordInputStream rinp = new RecordInputStream(ms);
rinp.NextRecord();
Record[] r = RecordFactory.CreateRecord(rinp);
if (r.Length != 1)
{
throw new InvalidOperationException("Re-serialised a record to clone it, but got " + r.Length + " records back!");
}
return r[0];
}
}
示例5: ProcessRecords
/**
* Create an array of records from an input stream
*
* @param in the InputStream from which the records will be
* obtained
*
* @exception RecordFormatException on error Processing the
* InputStream
*/
public void ProcessRecords(Stream in1)
{
Record last_record = null;
RecordInputStream recStream = new RecordInputStream(in1);
while (recStream.HasNextRecord) {
recStream.NextRecord();
Record[] recs = RecordFactory.CreateRecord(recStream); // handle MulRK records
if (recs.Length > 1) {
for (int k = 0; k < recs.Length; k++) {
if ( last_record != null ) {
if (!ProcessRecord(last_record)) {
return;
}
}
last_record = recs[ k ]; // do to keep the algorithm homogeneous...you can't
} // actually continue a number record anyhow.
} else {
Record record = recs[ 0 ];
if (record != null) {
if (last_record != null) {
if (!ProcessRecord(last_record)) {
return;
}
}
last_record = record;
}
}
}
if (last_record != null) {
ProcessRecord(last_record);
}
}