public int read(byte b[], int off, int len) throws IOException {
if (b == null) {
throw new NullPointerException();
} else if ((off < 0) || (off > b.length) || (len < 0) ||
((off + len) > b.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return 0;
} int c = read();
if (c == -1) {
return -1;
}
b[off] = (byte)c; int i = 1;
try {
for (; i < len ; i++) {
c = read();
if (c == -1) {
break;
}
if (b != null) {
b[off + i] = (byte)c;
}
}
} catch (IOException ee) {
}
return i;
}
if (b == null) {
throw new NullPointerException();
} else if ((off < 0) || (off > b.length) || (len < 0) ||
((off + len) > b.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return 0;
} int c = read();
if (c == -1) {
return -1;
}
b[off] = (byte)c; int i = 1;
try {
for (; i < len ; i++) {
c = read();
if (c == -1) {
break;
}
if (b != null) {
b[off + i] = (byte)c;
}
}
} catch (IOException ee) {
}
return i;
}
解决方案 »
- 1000分:请教一个JNA 调用 DLL的参数传递
- 菜鸟求助,马士兵贪吃蛇代码问题
- 简易QQ程序,怎么加多线程?
- 构建器内部的多形性方法的行为
- JFC中的Struts&Spring布局管理器
- 难道没人能帮我吗?高分相送!
- 20分请求java读取property文件的路径问题,着急呀!
- 我看到布局管理器就想吐,有没有其他的办法,呕呕呕呕呕
- 请问各位高手,为什么出现这种错误.
- I have a dream!! and i have 50 points to send to somebody.........
- 如何让这个try..catch..finally不报[finally block does not complete normally]警告??
- friendly 访问修饰符
read()是方法啊,你自己找找哪儿定义的吧
public abstract int read() throws IOException; 中的read()是个抽象类。那么c = read();有什么用处呢 ?
read()方法中什么都没有实现啊 ?这么写c到底是为了什么呢 ?
谁说给谁100分,都给他,先到先得的
由于java中以ojbect为类的根节点,所以实际上的实现
是在objectinputstream中通过内部类BlockDataInputStream来实现的 ,对吗?
高手们????!!!!