public class CaptchaUtils extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CaptchaUtils.Captcha |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
copyByte2File(byte[] data,
String file)
机能概要:将二进制数据转化为文件
|
byte[] |
copyImage2Byte(BufferedImage img)
机能概要:将图片转化为 二进制数据
|
CaptchaUtils.Captcha |
getCode()
机能概要:生成图片对象,并返回
|
String |
getCode(String path)
创建验证码
|
BufferedImage |
getImage()
调用这个方法得到验证码
|
static CaptchaUtils |
getInstance(int numberCnt)
实例化对象
|
String |
getText()
机能概要:
|
static void |
output(BufferedImage image,
OutputStream out) |
public static CaptchaUtils getInstance(int numberCnt)
public String getCode(String path) throws Exception
path - 路径地址Exception - 异常public CaptchaUtils.Captcha getCode() throws Exception
Exception - 异常public byte[] copyImage2Byte(BufferedImage img) throws Exception
img - 图片Exception - 异常public boolean copyByte2File(byte[] data,
String file)
throws Exception
data - file - Exceptionpublic BufferedImage getImage()
public String getText()
public static void output(BufferedImage image, OutputStream out) throws IOException
IOExceptionCopyright © 2022. All rights reserved.