/// <summary> /// Processes a DocumentInputStream into essentially Record events. /// </summary> /// <param name="req">an Instance of HSSFRequest which has your registered listeners</param> /// <param name="in1">a DocumentInputStream obtained from POIFS's POIFSFileSystem object</param> /// <returns>numeric user-specified result code.</returns> protected short GenericProcessEvents(HSSFRequest req, RecordInputStream in1) { bool going = true; short userCode = 0; Record r = null; // Create a new RecordStream and use that HSSFRecordStream recordStream = new HSSFRecordStream(in1); // Process each record as they come in while (going) { r = recordStream.NextRecord(); if (r != null) { userCode = req.ProcessRecord(r); if (userCode != 0) { break; } } else { going = false; } } // All done, return our last code return(userCode); }
/// <summary> /// Processes a DocumentInputStream into essentially Record events. /// </summary> /// <param name="req">an Instance of HSSFRequest which has your registered listeners</param> /// <param name="in1">a DocumentInputStream obtained from POIFS's POIFSFileSystem object</param> /// <returns>numeric user-specified result code.</returns> protected short GenericProcessEvents(HSSFRequest req, RecordInputStream in1) { bool going = true; short userCode = 0; Record r = null; // Create a new RecordStream and use that HSSFRecordStream recordStream = new HSSFRecordStream(in1); // Process each record as they come in while (going) { r = recordStream.NextRecord(); if (r != null) { userCode = req.ProcessRecord(r); if (userCode != 0) break; } else { going = false; } } // All done, return our last code return userCode; }