Class DataMatrixHighLevelEncoder

java.lang.Object
org.krysalis.barcode4j.impl.datamatrix.DataMatrixHighLevelEncoder
All Implemented Interfaces:
DataMatrixConstants

public class DataMatrixHighLevelEncoder extends Object implements DataMatrixConstants
DataMatrix ECC 200 data encoder following the algorithm described in ISO/IEC 16022:200(E) in annex S.
Version:
$Id: DataMatrixHighLevelEncoder.java,v 1.18 2011-10-15 13:37:18 jmaerki Exp $
  • Constructor Details

    • DataMatrixHighLevelEncoder

      public DataMatrixHighLevelEncoder()
  • Method Details

    • getBytesForMessage

      public static byte[] getBytesForMessage(String msg)
      Converts the message to a byte array using the default encoding (cp437) as defined by the specification
      Parameters:
      msg - the message
      Returns:
      the byte array of the message
    • encodeHighLevel

      public static String encodeHighLevel(String msg) throws IOException
      Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).
      Parameters:
      msg - the message
      Returns:
      the encoded message (the char values range from 0 to 255)
      Throws:
      IOException - if an I/O error occurs while fetching external data
    • encodeHighLevel

      public static String encodeHighLevel(String msg, SymbolShapeHint shape, Dimension minSize, Dimension maxSize) throws IOException
      Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).
      Parameters:
      msg - the message
      shape - requested shape. May be SymbolShapeHint.FORCE_NONE, SymbolShapeHint.FORCE_SQUARE or SymbolShapeHint.FORCE_RECTANGLE.
      minSize - the minimum symbol size constraint or null for no constraint
      maxSize - the maximum symbol size constraint or null for no constraint
      Returns:
      the encoded message (the char values range from 0 to 255)
      Throws:
      IOException - if an I/O error occurs while fetching external data
    • determineConsecutiveDigitCount

      public static int determineConsecutiveDigitCount(String msg, int startpos)
      Determines the number of consecutive characters that are encodable using numeric compaction.
      Parameters:
      msg - the message
      startpos - the start position within the message
      Returns:
      the requested character count