Class QRCode

java.lang.Object
com.helixframework.barcode.qr.QRCode

public class QRCode extends Object
Reads and writes QR codes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    read(byte[] data)
    Read a QR code from bytes.
    static byte[]
    read(File file)
    Read a QR code from a file.
    static byte[]
    write(byte[] data, int height, int width)
    Write a QR code as bytes.
    static void
    write(byte[] data, int height, int width, File file)
    Write a QR code to a file.
    static byte[]
    write(String data, int height, int width)
    Write a QR code as bytes.
    static void
    write(String data, int height, int width, File file)
    Write a QR code to a file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • read

      public static byte[] read(byte[] data) throws IOException, com.google.zxing.NotFoundException
      Read a QR code from bytes.
      Parameters:
      data - QR code
      Returns:
      QR code data
      Throws:
      IOException - if an error occurs reading the qr code
      com.google.zxing.NotFoundException - if the bytes do not contain a qr code
    • read

      public static byte[] read(File file) throws IOException, com.google.zxing.NotFoundException
      Read a QR code from a file.
      Parameters:
      file - QR code
      Returns:
      QR code data
      Throws:
      IOException - if an error occurs reading the qr code
      com.google.zxing.NotFoundException - if the bytes do not contain a qr code
    • write

      public static byte[] write(String data, int height, int width) throws com.google.zxing.WriterException, IOException
      Write a QR code as bytes.
      Parameters:
      data - QR code data
      height - QR code height in pixels
      width - QR code width in pixels
      Returns:
      QR code as bytes
      Throws:
      com.google.zxing.WriterException - if the data cannot be written as a QR code
      IOException - if the data cannot be written as a QR code
    • write

      public static byte[] write(byte[] data, int height, int width) throws com.google.zxing.WriterException, IOException
      Write a QR code as bytes.
      Parameters:
      data - QR code data
      height - QR code height in pixels
      width - QR code width in pixels
      Returns:
      QR code as bytes
      Throws:
      com.google.zxing.WriterException - if the data cannot be written as a QR code
      IOException - if the data cannot be written as a QR code
    • write

      public static void write(String data, int height, int width, File file) throws com.google.zxing.WriterException, IOException
      Write a QR code to a file.
      Parameters:
      data - QR code data
      height - QR code height in pixels
      width - QR code width in pixels
      file - QR code destination file
      Throws:
      com.google.zxing.WriterException - if the data cannot be written as a QR code
      IOException - if the data cannot be written as a QR code
    • write

      public static void write(byte[] data, int height, int width, File file) throws com.google.zxing.WriterException, IOException
      Write a QR code to a file.
      Parameters:
      data - QR code data
      height - QR code height in pixels
      width - QR code width in pixels
      file - QR code destination file
      Throws:
      com.google.zxing.WriterException - if the data cannot be written as a QR code
      IOException - if the data cannot be written as a QR code