Class BarcodeTool


  • public class BarcodeTool
    extends java.lang.Object
    Barcodes toolbox
    This class only provides static variables and methods
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int checkSum​(java.lang.String code)
      Calculate checksum for EAN13 or EAN8 code
      static byte[] ean13Image​(java.lang.String ean)
      Generate a EAN 13 JPEG as byte array
      static boolean validate​(java.lang.String code)
      Validate an EAN13 or EAN8
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • checkSum

        public static int checkSum​(java.lang.String code)
        Calculate checksum for EAN13 or EAN8 code
        Parameters:
        code - EAN code without checksum (e.g. length 12 for an EAN13 or 7 for an EAN 8)
        Returns:
        Checksum digit or -1 in case of error
      • validate

        public static boolean validate​(java.lang.String code)
        Validate an EAN13 or EAN8
        Parameters:
        code -
        Returns:
        True if EAN code is valid
      • ean13Image

        public static byte[] ean13Image​(java.lang.String ean)
        Generate a EAN 13 JPEG as byte array
        Parameters:
        ean - EAN number
        Returns:
        EAN 13 as byte array