int num=inputstream.read(byt2);
System.out.println(new String(byt2,0,num));
stock.close();
}
}
程序不知道哪里有问题报错:Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.checkBounds(String.java:398)
at java.lang.String.<init>(String.java:570)
at manyfile.ManyFile.main(ManyFile.java:37) 作者: 杨华威 时间: 2012-4-24 16:17
InputStream intputstream=stock.getInputStream(); //这里定义的是:intputstream
byte[] byt2=new byte[1024*1024];
int num=inputstream.read(byt2); // 这里,应该是intputstream.read(byt2);少写了单词t