File fi=new File("D:\\20110221144419.xls");
System.out.println(11);
//创建一个工作薄
POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream(fi));
HSSFWorkbook wb=new HSSFWorkbook(fs);
int i = 0;
HSSFSheet hsheet = wb.getSheetAt(i);
if(hsheet==null)
hsheet = wb.createSheet("Sheet"+(i)+"");
HSSFPatriarch patriarch = hsheet.createDrawingPatriarch();
HSSFClientAnchor anchor = new HSSFClientAnchor(0,0,512,255,(short) 1,1,(short)10,20);
patriarch.createPicture(anchor , wb.addPicture(byteArrayOut.toByteArray(),HSSFWorkbook.PICTURE_TYPE_JPEG));
fileOut= new FileOutputStream(fi);
//写入excel文件
wb.write(fileOut);
fileOut.close();
新建一个File对象写进去