Class QRCodeTool


  • public class QRCodeTool
    extends java.lang.Object
    QRCode toolbox
    This class only provides static variables and methods
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_SIZE
      Default size
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] qrCodeImage​(java.lang.String data)
      Get QRCode image for specified data
      static byte[] qrCodeImage​(java.lang.String data, int size)
      Get QRCode image for specified data
      static java.io.File qrCodeImage​(java.lang.String path, java.lang.String data)
      Generate QR code image file for specified data
      static java.io.File qrCodeImage​(java.lang.String path, java.lang.String data, int size)
      Generate QR code image file for specified data
      • Methods inherited from class java.lang.Object

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

      • qrCodeImage

        public static byte[] qrCodeImage​(java.lang.String data)
        Get QRCode image for specified data
        Parameters:
        data - Data
        Returns:
        PNG image as byte array
      • qrCodeImage

        public static byte[] qrCodeImage​(java.lang.String data,
                                         int size)
        Get QRCode image for specified data
        Parameters:
        data - Data
        size - Size (width and height) in pixels (no less than 128)
        Returns:
        PNG image as byte array
      • qrCodeImage

        public static java.io.File qrCodeImage​(java.lang.String path,
                                               java.lang.String data)
        Generate QR code image file for specified data
        Parameters:
        path - Destinaton file path
        data - Data
        Returns:
        Generated file
      • qrCodeImage

        public static java.io.File qrCodeImage​(java.lang.String path,
                                               java.lang.String data,
                                               int size)
        Generate QR code image file for specified data
        Parameters:
        path - Destinaton file path
        data - Data
        size - Size in pixels (no less than 128)
        Returns:
        Generated file