日期:2014-05-20  浏览次数:20722 次

如何将一个文件中的所有数据放到一个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);
}