当前位置:网站首页>Convert bufferedimage into byte[] array, and the pro test is available
Convert bufferedimage into byte[] array, and the pro test is available
2022-07-16 06:06:00 【Kuo-Teng】
take BufferedImage To byte[] Array , Close test available
Sometimes we just want to base it on BufferedImage To get one byte[], So that it can be base64 code . At this time, the following methods can be considered , It can avoid generating pictures to disk , Read from disk and convert to byte[] Code again .
/** * take BufferedImage Convert to byte[] * @param image * @return */
public byte[] bufferedImageToByteArray(BufferedImage image) throws IOException{
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(image, "png", os);
return os.toByteArray();
}
边栏推荐
猜你喜欢

网络通信安全部分笔记一

Unity experiment - simulating the motion of stars in the solar system

Notes on network communication security -- static routing and experiment

Intranet penetration notes --:) a smiling face

38.js-- prototype exercise cases (face-to-face examination questions for proofreading)

About the installation and use of visual studio 2022

Intranet penetration notes - vulnhub intranet course completion penetration

Some small problems encountered in using Baidu lightweight server LS

Network security emergency response terminal detection and response technology
![[NCTF2019]Fake XML cookbook](/img/d4/e5ff896108c86179526a06911abd38.png)
[NCTF2019]Fake XML cookbook
随机推荐
MySQL DQL conditional query / aggregate function / grouping query / sorting query / paging query
Simply understand the three handshakes and four waves of TCP
MySQL multi table query internal connection / external connection / self connection
Some small problems encountered in using Baidu lightweight server LS
Notes 1 of network communication security
网络安全应急响应-终端检测与响应技术
ES6 -- Interview Questions
About the installation and use of visual studio 2022
For some problems encountered in using crontab, errors are reported /var/spool/cron: permission denied and bash: /usr/bin/chattr: permission denied
Notes on network communication security -- OSPF theory and experiment
Compilation principle - lexical analyzer design
网络通信安全部分笔记——静态路由及实验
Intranet penetration notes - Three Layer Discovery and four layer discovery
SNMP started
使用百度轻量服务器LS遇到的一些小问题
ES6 -- conversion of arr (array) -map set
图形图像编程实践 课程报告
Infrastructure nftscan officially released Solana network NFT browser
Dense Digital Economy: using passwords to "search for pearls in the deep sea"
PHP docking wechat payment native TP5 framework