C# Class Summer.Batch.Extra.Ebcdic.EbcdicReader

An EbcdicReader reads bytes from an input stream and returns records, according to a copybook. Each call to NextRecord returns a list of objects, containing the decoded values of the fields. When there are no more records to read, it returns null. Copybooks with multiple records are supported. The reader relies on the position get/set methods of the input stream to detect the format of the current record.
显示文件 Open project: SummerBatch/SummerBatch Class Usage Examples

Public Methods

Method Description
EbcdicReader ( BufferedStream inputStream, Summer.Batch.Extra.Copybook.FileFormat fileFormat, bool hasRdw ) : System

Constructs an EbcdicReader.

NextRecord ( ) : List

Returns the next record as a list of objects.

Private Methods

Method Description
Read ( int length, Summer.Batch.Extra.Copybook.FieldFormat fieldFormat ) : byte[]

Technical read byte array, given length and field format

ReadDiscriminatorValue ( ) : string

read the discriminator value

ReadField ( Summer.Batch.Extra.Copybook.FieldFormat fieldFormat, decimal>.IDictionary readNumericValues ) : object

read a field

ReadFields ( IFieldsList fieldsList ) : List

read a fields list

ReadFieldsGroup ( Summer.Batch.Extra.Copybook.FieldsGroup fieldsGroup, decimal>.IDictionary readNumericValues ) : List

read a fields group

RetrieveRecordFormat ( ICollection values ) : Summer.Batch.Extra.Copybook.RecordFormat

retrieve record format

Method Details

EbcdicReader() public method

Constructs an EbcdicReader.
public EbcdicReader ( BufferedStream inputStream, Summer.Batch.Extra.Copybook.FileFormat fileFormat, bool hasRdw ) : System
inputStream System.IO.BufferedStream the stream to read the data from
fileFormat Summer.Batch.Extra.Copybook.FileFormat the copybook to use for decoding records
hasRdw bool true if records have a record descriptor word (RDW)
return System

NextRecord() public method

Returns the next record as a list of objects.
   
public NextRecord ( ) : List
return List