类 QrCodeHandler
java.lang.Object
cloud.opencode.base.tool.qrcode.QrCodeHandler
- 版本:
- v1.0.0
- 作者:
- Jon So, e-mail: ijonso123@gmail.com url: Jon's blog url: project github
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private static StringcheckCodeText(String codeText) Check QR code textstatic StringcreateQrCode2File(String codeText, String savePath, QrConfig config) Create a QR code and save it to the specified pathstatic voidcreateQrCode2Stream(String codeText, OutputStream outputStream, QrConfig config) Create QR code and write to streamstatic StringdecodeQrCode2Txt(String qrCodePath) Scan qrcode file and return textprivate static BufferedImageencodeQrCode(String codeText, QrConfig config) Encode text to BufferedImageprivate static FileGet qrcode file
-
构造器详细资料
-
QrCodeHandler
public QrCodeHandler()
-
-
方法详细资料
-
createQrCode2File
public static String createQrCode2File(String codeText, String savePath, QrConfig config) throws com.google.zxing.WriterException, IOException Create a QR code and save it to the specified path- 参数:
codeText- QR code textsavePath- Save path- 抛出:
com.google.zxing.WriterExceptionIOException
-
createQrCode2Stream
public static void createQrCode2Stream(String codeText, OutputStream outputStream, QrConfig config) throws com.google.zxing.WriterException, IOException Create QR code and write to stream- 参数:
codeText- QR code textoutputStream- stream- 抛出:
com.google.zxing.WriterExceptionIOException
-
decodeQrCode2Txt
Scan qrcode file and return text- 参数:
qrCodePath- qrcode file path- 返回:
- qrcode text
-
getFile
Get qrcode file- 参数:
filePath-- 返回:
- File
-
checkCodeText
Check QR code text- 参数:
codeText-- 返回:
- String
-
encodeQrCode
Encode text to BufferedImage- 参数:
codeText-- 返回:
- BufferedImage
-