C# Class Summer.Batch.Extra.Ebcdic.Encode.EbcdicDecoder

Decodes EBCDIC values to their corresponding C# objects.
Datei anzeigen Open project: SummerBatch/SummerBatch Class Usage Examples

Public Methods

Method Description
Decode ( byte bytes, Summer.Batch.Extra.Copybook.FieldFormat fieldFormat ) : object

Main decode method. Switch based on the given FieldFormat

EbcdicDecoder ( Encoding encoding ) : System

Custom constructor given encoding

EbcdicDecoder ( string encodingName ) : System

Custom constructor given encoding name

ParsePacked ( byte bytes ) : decimal

Parses a packed number

ParsePacked ( byte bytes, int start, int end ) : decimal

Parses a packed number

ParseZoned ( string value ) : decimal

Parses a Zoned number

Private Methods

Method Description
DecodeHex ( byte bytes ) : string

Decode byte array as hexadecimal

DecodePacked ( byte bytes, Summer.Batch.Extra.Copybook.FieldFormat fieldFormat ) : decimal

Decode a byte array using the packed format

DecodeZoned ( byte bytes, Summer.Batch.Extra.Copybook.FieldFormat fieldFormat ) : decimal

Decode a byte array using the zoned format

GetLastIndex ( char lastChar, bool &positive ) : string
ScaleResult ( Summer.Batch.Extra.Copybook.FieldFormat fieldFormat, decimal result ) : decimal

Scale result using the given fieldFormat

Method Details

Decode() public method

Main decode method. Switch based on the given FieldFormat
 
public Decode ( byte bytes, Summer.Batch.Extra.Copybook.FieldFormat fieldFormat ) : object
bytes byte
fieldFormat Summer.Batch.Extra.Copybook.FieldFormat
return object

EbcdicDecoder() public method

Custom constructor given encoding
public EbcdicDecoder ( Encoding encoding ) : System
encoding System.Text.Encoding
return System

EbcdicDecoder() public method

Custom constructor given encoding name
public EbcdicDecoder ( string encodingName ) : System
encodingName string
return System

ParsePacked() public static method

Parses a packed number
public static ParsePacked ( byte bytes ) : decimal
bytes byte a byte array where a number has been pack encoded
return decimal

ParsePacked() public static method

Parses a packed number
public static ParsePacked ( byte bytes, int start, int end ) : decimal
bytes byte a byte array where a number has been pack encoded
start int the beginning index, inclusive
end int the end index, exclusive
return decimal

ParseZoned() public static method

Parses a Zoned number
public static ParseZoned ( string value ) : decimal
value string a string where a number has been zone encoded
return decimal