Package com.helixframework.barcode.qr
Class QRCode
java.lang.Object
com.helixframework.barcode.qr.QRCode
Reads and writes QR codes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]read(byte[] data) Read a QR code from bytes.static byte[]Read a QR code from a file.static byte[]write(byte[] data, int height, int width) Write a QR code as bytes.static voidWrite a QR code to a file.static byte[]Write a QR code as bytes.static voidWrite a QR code to a file.
-
Method Details
-
read
Read a QR code from bytes.- Parameters:
data- QR code- Returns:
- QR code data
- Throws:
IOException- if an error occurs reading the qr codecom.google.zxing.NotFoundException- if the bytes do not contain a qr code
-
read
Read a QR code from a file.- Parameters:
file- QR code- Returns:
- QR code data
- Throws:
IOException- if an error occurs reading the qr codecom.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 dataheight- QR code height in pixelswidth- QR code width in pixels- Returns:
- QR code as bytes
- Throws:
com.google.zxing.WriterException- if the data cannot be written as a QR codeIOException- 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 dataheight- QR code height in pixelswidth- QR code width in pixels- Returns:
- QR code as bytes
- Throws:
com.google.zxing.WriterException- if the data cannot be written as a QR codeIOException- 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 dataheight- QR code height in pixelswidth- QR code width in pixelsfile- QR code destination file- Throws:
com.google.zxing.WriterException- if the data cannot be written as a QR codeIOException- 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 dataheight- QR code height in pixelswidth- QR code width in pixelsfile- QR code destination file- Throws:
com.google.zxing.WriterException- if the data cannot be written as a QR codeIOException- if the data cannot be written as a QR code
-