Interface BarcodeDecoder

  • All Known Implementing Classes:
    DefaultBarcodeDecoder

    public interface BarcodeDecoder
    An interface for reading/decoding barcodes (QR/Aztec).
    Author:
    Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)
    • Method Detail

      • decode

        byte[] decode​(byte[] image,
                      Barcode.BarcodeType type)
               throws BarcodeException
        Locates the barcode in the supplied image and decodes it.
        Parameters:
        image - the bytes of the images holding the barcode
        type - the type of barcode (set to null if not known)
        Returns:
        the contents of the barcode
        Throws:
        BarcodeException - for decoding errors
      • decodeToString

        String decodeToString​(byte[] image,
                              Barcode.BarcodeType type,
                              Charset characterSet)
                       throws BarcodeException
        Locates the barcode in the supplied image and decodes it into a string of the given character set.
        Parameters:
        image - the bytes of the images holding the barcode
        type - the type of barcode (set to null if not known)
        characterSet - the character set
        Returns:
        the contents of the barcode
        Throws:
        BarcodeException - for decoding errors