很简单的代码就可实现
@Test
public void Code() throws FileNotFoundException, IOException{
VerifyCode verifyCode = new VerifyCode();
BufferedImage bi = verifyCode.getImage();//随机
System.out.println(verifyCode.getText());//读取
verifyCode.output(bi, new FileOutputStream("D:/a.jpg"));
}