Class IsoDecoder<M extends IsoMessage>

java.lang.Object
cl.netswitch.iso.iso8583.IsoDecoder<M>
Type Parameters:
M - the type of the ISO message.
Direct Known Subclasses:
IsoTlvDecoder

public class IsoDecoder<M extends IsoMessage> extends Object
Decodes a sequence of bytes into the fields of an IsoMessage.
  • Constructor Details

    • IsoDecoder

      public IsoDecoder(IsoFields<M> fields)
      Constructs a new IsoDecoder instance.
      Parameters:
      fields - the fields that describe a message.
      Throws:
      NullPointerException - if fields is null.
      IsoException - if required fields are not defined.
  • Method Details

    • decode

      public final void decode(byte[] bytes, M message)
      Decodes a sequence of bytes into the fields of a message.
      Parameters:
      bytes - the bytes to be decoded into message.
      message - the message where decoded fields are stored.
      Throws:
      NullPointerException - if an argument is null.
      IsoException - if an unexpected decoder error occurs.
    • preDecode

      protected void preDecode(ByteBuffer buffer, M message)
      Called before a message is decoded from the supplied byte buffer.
      Parameters:
      buffer - the buffer containing the bytes to be decoded.
      message - the message where decoded fields are stored.
      Throws:
      NullPointerException - if an argument is null.
      IsoException - if an expected decoder error occurs.
    • postDecode

      protected void postDecode(ByteBuffer buffer, M message)
      Called after a message is decoded from the supplied byte buffer.
      Parameters:
      buffer - the buffer containing the bytes to be decoded.
      message - the message where decoded fields are stored.
      Throws:
      NullPointerException - if an argument is null.
      IsoException - if an expected decoder error occurs.