绅士的大脸猫 · 武汉市人民政府门户网站· 4 月前 · |
叛逆的橡皮擦 · 作业帮商城 | 易库电商仓储· 5 月前 · |
打篮球的火车 · 搜索 | Autodesk University· 6 月前 · |
失落的小虾米 · Java8中两个优雅的特性 - ...· 7 月前 · |
挂过科的韭菜 · java 修改string的值-掘金· 9 月前 · |
绅士的大脸猫 · 武汉市人民政府门户网站 4 月前 |
叛逆的橡皮擦 · 作业帮商城 | 易库电商仓储 5 月前 |
打篮球的火车 · 搜索 | Autodesk University 6 月前 |
挂过科的韭菜 · java 修改string的值-掘金 9 月前 |
That does not seem to make sense, what exactly is it you are trying to achieve?
http://www.javaalmanac.com/egs/javax.imageio/Graphic2File.html
BTW, how on earth do you get to the posts so quickly??????
Thanks,
David
What do want the input stream for?
Thanks,
David
If you want to write it to somewhere then use ImageIO.write() with the output stream you want to write it to
//generating screenshot
BufferedImage bufferedImage = robot.createScreenCapture(
//grabbing output
PrintStream out=new PrintStream(new BufferedOutputStream(socke
//setting mime type
String mimeType="image/jpeg";
//returning ok message and mime type to browser
out.print("HTTP/1.0 200 OK\r\n" + "Content-type: "+mimeType+"\r\n\r\n");
//send data to client
//***********IF I'M SENDING DATA FROM A FILE, I USE THE FOLLOWING CODE
byte[] a=new byte[4096];
int n;
while ((n=f.read(a))>0)
out.write(a, 0, n);
out.close();
//************END SENDING
The last section is what I need to change. I would like to send the BufferedImage I created at the beginning of that snippet
Thanks,
David
Lost my connection before I could get back to post this.
Thanks,
David