Summer.Batch.Extra.Ebcdic.Encode.EbcdicEncoder Class Reference

Encode C# objects to EBCDIC More...

Public Types

enum  DefaultValue { DefaultValue.LowValue, DefaultValue.Zero, DefaultValue.Space }
 Enumeration that represents what byte should be used as default value when the encoded value is padded to match the size of the field. More...
 

Public Member Functions

 EbcdicEncoder (string encodingName)
 Custom constructor using encoding name More...
 
 EbcdicEncoder (Encoding encoding)
 Custom constructor using encoding More...
 
byte[] Encode (object field, FieldFormat fieldFormat)
 Encodes a C# object to a byte array using EBCDIC format. Main method. More...
 

Static Public Member Functions

static byte[] EncodePacked (decimal value, int size)
 Encodes a decimal as a packed number, using defaults. More...
 
static byte[] EncodePacked (decimal value, int size, int nbDecimals, bool signed)
 Encodes a decimal as a packed number. More...
 
static string EncodeZoned (decimal value, int size)
 Encode decimal as zoned number, using defaults. More...
 
static string EncodeZoned (decimal value, int size, int nbDecimals, bool signed, bool impliedDecimal)
 Encode decimal as zoned number. More...
 

Properties

DefaultValue DefVal [set]
 DefaultValue property; More...
 

Detailed Description

Encode C# objects to EBCDIC

Member Enumeration Documentation

Enumeration that represents what byte should be used as default value when the encoded value is padded to match the size of the field.

Enumerator
LowValue 

Indicates that low value (0x00) should be used as default value.

Zero 

Indicates that the character zero ('0') should be used as default value.

Space 

Indicates that the space character (' ') should be used as default value.

Constructor & Destructor Documentation

Summer.Batch.Extra.Ebcdic.Encode.EbcdicEncoder.EbcdicEncoder ( string  encodingName)

Custom constructor using encoding name

Parameters
encodingName
Summer.Batch.Extra.Ebcdic.Encode.EbcdicEncoder.EbcdicEncoder ( Encoding  encoding)

Custom constructor using encoding

Parameters
encoding

Member Function Documentation

byte [] Summer.Batch.Extra.Ebcdic.Encode.EbcdicEncoder.Encode ( object  field,
FieldFormat  fieldFormat 
)

Encodes a C# object to a byte array using EBCDIC format. Main method.

Parameters
fieldthe object to encode
fieldFormatthe format of the field
Returns
an array of byte with the encoded field value
Exceptions
ValueTypeMismatchException if the object to encode is not of the expected type
UnexpectedFieldTypeException if the type field is unknown or unsupported
static byte [] Summer.Batch.Extra.Ebcdic.Encode.EbcdicEncoder.EncodePacked ( decimal  value,
int  size 
)
static

Encodes a decimal as a packed number, using defaults.

Parameters
value
size
Returns
static byte [] Summer.Batch.Extra.Ebcdic.Encode.EbcdicEncoder.EncodePacked ( decimal  value,
int  size,
int  nbDecimals,
bool  signed 
)
static

Encodes a decimal as a packed number.

Parameters
value
size
nbDecimals
signed
Returns
static string Summer.Batch.Extra.Ebcdic.Encode.EbcdicEncoder.EncodeZoned ( decimal  value,
int  size 
)
static

Encode decimal as zoned number, using defaults.

Parameters
value
size
Returns
static string Summer.Batch.Extra.Ebcdic.Encode.EbcdicEncoder.EncodeZoned ( decimal  value,
int  size,
int  nbDecimals,
bool  signed,
bool  impliedDecimal 
)
static

Encode decimal as zoned number.

Parameters
value
size
nbDecimals
signed
impliedDecimal
Returns

Property Documentation

DefaultValue Summer.Batch.Extra.Ebcdic.Encode.EbcdicEncoder.DefVal
set

DefaultValue property;


The documentation for this class was generated from the following file:
  • Summer.Batch.Extra/Ebcdic/Encode/EbcdicEncoder.cs