Class IsoEncoder<M extends IsoMessage>
java.lang.Object
cl.netswitch.iso.iso8583.IsoEncoder<M>
- Type Parameters:
M- the type of the ISO message.
Encodes the fields of an
IsoMessage into a sequence of bytes.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal byte[]Encodes the fields of a message into a sequence of bytes.protected voidpostEncode(M message, ByteArray barray) Called after a message is encoded into the supplied byte array.protected voidCalled before a message is encoded into the supplied byte array.
-
Constructor Details
-
IsoEncoder
Constructs a newIsoEncoderinstance.- Parameters:
fields- the fields that describe a message.- Throws:
NullPointerException- iffieldsisnull.IsoException- if required fields are not defined.
-
-
Method Details
-
encode
Encodes the fields of a message into a sequence of bytes.- Parameters:
message- the message that contains the field values.addMac- iftrueadds MAC bit to bitmap.- Returns:
- the sequence of bytes with the encoded field values.
- Throws:
NullPointerException- ifmessageisnull.IsoException- if an unexpected encoder error occurs.
-
preEncode
Called before a message is encoded into the supplied byte array.- Parameters:
message- the message to be encoded intobarray.barray- the byte array containing the encoded bytes.- Throws:
NullPointerException- if an argument isnull.IsoException- if an expected encoder error occurs.
-
postEncode
Called after a message is encoded into the supplied byte array.- Parameters:
message- the message to be encoded intobarray.barray- the byte array containing the encoded bytes.- Throws:
NullPointerException- if an argument isnull.IsoException- if an expected encoder error occurs.
-