read
public int read(byte[] b)
throws IOException
Reads up to b.length bytes of data from this input stream into an array of bytes. This method blocks until some input is available. Overrides:
read in class InputStream
Parameters:
b - the buffer into which the data is read.
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached.
Throws:
IOException - if an I/O error occurs.
See Also:
InputStream.read(byte[], int, int)--------------------------------------------------------------------------------主要就是 判断时候还有文件没有读入!
public int read(byte[] b)
throws IOException
Reads up to b.length bytes of data from this input stream into an array of bytes. This method blocks until some input is available. Overrides:
read in class InputStream
Parameters:
b - the buffer into which the data is read.
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached.
Throws:
IOException - if an I/O error occurs.
See Also:
InputStream.read(byte[], int, int)--------------------------------------------------------------------------------主要就是 判断时候还有文件没有读入!
解决方案 »
- 如何比较类和接口是不是继承自同样的接口
- 自定义标签类--如何调用DAO
- 求教更好的解决这个问题
- 急!!Java问题:运行SQL后,如何将返回的ResultSet对象中的某一列值 存入 String对象中
- 基础: 递归的问题
- 关于Applet的问题(100分:8月29结帖)!
- 如何处理在多线程环境下hashmap的线程不安全?
- 急!!!一个很简单的问题,谁回答出来我给他(她)100分!!!!
- 整日与电脑为伍,致使头发日渐稀少,请问个位该怎么办?
- 电脑报刊登“微软挥刀砍Java”一文,说Windows XP不支持Java,不知大家对Java的前景如何看待?
- jbuilder 9 的applet 如何在网页用HTML调用?
- 100分,知道的哥们赶快来拿...
这个方法的用法
Parameters
b
the buffer into which the data is read.
off
the start offset of the data.
len
the maximum number of bytes read.
Returns
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached.
Description
Reads up to len bytes of data from this input stream into an array of bytes. This method blocks until some input is available. Exceptions
IOException if an I/O error occurs.
看看有没有用。
从off位置开始读len长字节入b