首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

怎么将一个文件中的所有数据放到一个ByteArrayInputStream阿

2011-12-02 
如何将一个文件中的所有数据放到一个ByteArrayInputStream阿?二进制方式打开文件,想把数据放到ByteArrayIn

如何将一个文件中的所有数据放到一个ByteArrayInputStream阿?
二进制方式打开文件,   想把数据放到     ByteArrayInputStream

求教!

[解决办法]
public static void main(String[] args) throws IOException {
byte[] bs = new byte[1024 * n];
int count = new FileInputStream( "file path ").read(bs);
ByteArrayInputStream bip = new ByteArrayInputStream(bs, 0, count);
}

热点排行