由 FileInputStream 怎么得到 ByteArrayOutputStream ? InputStream怎么能到OutputStream呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 FileInputStream fis = new FileInputStream(new File("test.txt")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[128]; int iLength = 0; while((iLength = fis.read(buffer)) != -1) { baos.write(buffer, 0, iLength); } fis.close(); baos.close(); corba+java 请教:jscrollpane的竖向滚动条可以自动滚动,但是有时候滚动不到最下方? Java有前途吗?欢迎大家来讨论 怎样将网页上的图片保存在硬盘上 为什么java中的某些类不能引用 (急,求救)通过java调出一个cmd窗口,然后与之交互的问题,在线等 "String[] args"与String args[]的区别 请问JAVA WEB START 这个软件是干什么用的? 如何等待一个线程结束? 域名 JAVA线程使用的问题 请教基本问题
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[128];
int iLength = 0;
while((iLength = fis.read(buffer)) != -1) {
baos.write(buffer, 0, iLength);
}
fis.close();
baos.close();