Interface Interpreter

All Known Implementing Classes:
AsciiInterpreter, BCDInterpreter, EbcdicInterpreter, HEXInterpreter, LiteralInterpreter, SignedEbcdicNumberInterpreter

public interface Interpreter
Implementations convert Strings into byte arrays and vice versa.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getPackedLength(int nDataUnits)
    Returns the number of bytes required to interpret a String of length nDataUnits.
    void
    interpret(String data, byte[] b, int offset)
    Converts the string data into a different interpretation.
    uninterpret(byte[] rawData, int offset, int length)
    Converts the byte array into a String.
  • Method Details

    • interpret

      void interpret(String data, byte[] b, int offset) throws ISOException
      Converts the string data into a different interpretation. Standard interpretations are ASCII, EBCDIC, BCD and LITERAL.
      Throws:
      ISOException - on error
    • uninterpret

      String uninterpret(byte[] rawData, int offset, int length) throws ISOException
      Converts the byte array into a String. This reverses the interpret method.
      Parameters:
      rawData - The interpreted data.
      offset - The index in rawData to start interpreting at.
      length - The number of data units to interpret.
      Returns:
      The uninterpreted data.
      Throws:
      ISOException - on error
    • getPackedLength

      int getPackedLength(int nDataUnits)
      Returns the number of bytes required to interpret a String of length nDataUnits.