如何把bufferedimage在内存中创建成的图片转换成byte数组...在线等待 FileInputStream fi=new FileInputStream(path1);byte data[]=new byte[fi.available()];fi.read(data); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 java.io.BufferedInputStream bis=new java.io.BufferedInputStream(new java.io.FileInputStream("img.jpg"));byte[] b=new byte[bis.available()];bis.read(b); 搞错了。。是内存中的图片。。不在硬盘上 还有.available()不是准的返回流的深度.read()也只能读buffsize个字节 java.io.BufferedInputStream bis=new java.io.BufferedInputStream(new java.io.FileInputStream("img.jpg"));byte[] buffer = new byte[1024]; int readCount; while((readCount = bis.read(buffer)) > 0) { bis.read(buffer, 0, readCount); } 一个随机数的程序 关于Thinking in java中作者自己定义的类 对于Java中编码解码的一点理解,各位看对吗?要不然该是怎样? 如何学习Java?我从来没有接触过Java 如何获取数组元素的问题 关于包的问题 输入AAABBBCC,怎么样输出A3B3C2 帮忙看看老师的作业 初学者的疑惑! 有没有人能提供resin的httpd参数的中文说明啊 Java中的继承是运行时继承吗?看下面代码 JAVA虚拟机到底在哪里啊?谢了!
byte[] b=new byte[bis.available()];
bis.read(b);
还有.available()不是准的返回流的深度
.read()也只能读buffsize个字节
byte[] buffer = new byte[1024];
int readCount;
while((readCount = bis.read(buffer)) > 0) {
bis.read(buffer, 0, readCount);
}