@Test public void encodeToStream() throws Exception { String format = "png"; File file = new File("e:\\t\\zxing\\qrcode." + format); if (!file.exists()) file.mkdirs(); OutputStream stream = new FileOutputStream(file); String content = "http: QRCodeUtils.encode(content, stream, format); }
public static void encode(String content, File file) throws Exception { MultiFormatWriter barcodeWriter = new MultiFormatWriter(); BitMatrix matrix = barcodeWriter.encode(content, BarcodeFormat.QR_CODE, DEFAULT_SIZE, DEFAULT_SIZE, encodeHints); if (!file.exists()) file.mkdirs(); String format = getFormat(file); MatrixToImageWriter.writeToFile(matrix, format, file); }
QRCodeUtils { public static void encode(String content, File file) throws Exception { MultiFormatWriter barcodeWriter = new MultiFormatWriter(); BitMatrix matrix = barcodeWriter.encode(content, BarcodeFormat.QR_CODE, DEFAULT_SIZE, DEFAULT_SIZE, encodeHints); if (!file.exists()) file.mkdirs(); String format = getFormat(file); MatrixToImageWriter.writeToFile(matrix, format, file); } }
QRCodeUtils { public static void encode(String content, File file) throws Exception { MultiFormatWriter barcodeWriter = new MultiFormatWriter(); BitMatrix matrix = barcodeWriter.encode(content, BarcodeFormat.QR_CODE, DEFAULT_SIZE, DEFAULT_SIZE, encodeHints); if (!file.exists()) file.mkdirs(); String format = getFormat(file); MatrixToImageWriter.writeToFile(matrix, format, file); } private  QRCodeUtils(); }
QRCodeUtils { public static void encode(String content, File file) throws Exception { MultiFormatWriter barcodeWriter = new MultiFormatWriter(); BitMatrix matrix = barcodeWriter.encode(content, BarcodeFormat.QR_CODE, DEFAULT_SIZE, DEFAULT_SIZE, encodeHints); if (!file.exists()) file.mkdirs(); String format = getFormat(file); MatrixToImageWriter.writeToFile(matrix, format, file); } private  QRCodeUtils(); static void encode(String content, File file); static void encode(String content, OutputStream stream, String format); static String decode(File file); static String decode(InputStream inputStream); static String decode(BufferedImage image); }
QRCodeUtils { public static void encode(String content, File file) throws Exception { MultiFormatWriter barcodeWriter = new MultiFormatWriter(); BitMatrix matrix = barcodeWriter.encode(content, BarcodeFormat.QR_CODE, DEFAULT_SIZE, DEFAULT_SIZE, encodeHints); if (!file.exists()) file.mkdirs(); String format = getFormat(file); MatrixToImageWriter.writeToFile(matrix, format, file); } private  QRCodeUtils(); static void encode(String content, File file); static void encode(String content, OutputStream stream, String format); static String decode(File file); static String decode(InputStream inputStream); static String decode(BufferedImage image); static String DEFAULT_ENCODE; static int DEFAULT_SIZE; static String DEFAULT_FORMAT; }