讀取二維碼是出現(xiàn)異常
String result = new String(decoder.decode(new MyQRCodeImage(image)),"utf-8");
這個(gè)地方報(bào)了下標(biāo)越界異常是怎么回事
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at jp.sourceforge.qrcode.pattern.FinderPattern.getWidth(FinderPattern.java:525)
at jp.sourceforge.qrcode.pattern.FinderPattern.findFinderPattern(FinderPattern.java:49)
at jp.sourceforge.qrcode.reader.QRCodeImageReader.getQRCodeSymbol(QRCodeImageReader.java:172)
at jp.sourceforge.qrcode.QRCodeDecoder.decode(QRCodeDecoder.java:141)
at jp.sourceforge.qrcode.QRCodeDecoder.decode(QRCodeDecoder.java:70)
at com.c82.qrcode.qrcode.ReadQRCode.main(ReadQRCode.java:33)
2017-12-15
應(yīng)該是二維碼生成時(shí)的循環(huán),沒有加偏移量(視頻中老師沒有操作),導(dǎo)致解析時(shí)數(shù)組下標(biāo)越界,圖片中紅線處,復(fù)制過來的源碼是沒有加的
2017-08-25
你好,你是怎么解決的,我的代碼跟視屏的一樣??!但還是報(bào)錯(cuò)呢?謝謝啦
2017-06-28
代碼有錯(cuò)誤,上圖!