admin 管理员组

文章数量: 1086019


2024年4月19日发(作者:批处理教程最全版)

由于工作需要,需要把图片存入xml中,在需要时在把图片从xml中取出。

图片存入xml:

把图片用base64编码

把编码字符串存入xml

Java代码

private String readImage() {

BufferedInputStream bis = null;

byte[] bytes = null;

try {

try {

bis = new BufferedInputStream(new FileInputStream(ix));

bytes = new byte[ble()];

(bytes);

} finally {

if (bis != null) {

();

}

}

} catch (FileNotFoundException e) {

tackTrace();

} catch (IOException e) {

tackTrace();

}

return new BASE64Encoder().encodeBuffer(bytes);

}

private String readImage() { BufferedInputStream bis = null; byte[] bytes = null;

try { try { bis = new BufferedInputStream(new


本文标签: 需要 图片 存入