| 76 | } |
| 77 | |
| 78 | public int read(byte b[], int off, int len) throws IOException { |
| 79 | if(b == null) |
| 80 | throw new IllegalArgumentException(); |
| 81 | if (peer == 0) |
| 82 | throw new IOException(); |
| 83 | if(len == 0) |
| 84 | return 0; |
| 85 | if (position + len > this.length) |
| 86 | throw new EOFException(); |
| 87 | if (off < 0 || off + len > b.length) |
| 88 | throw new ArrayIndexOutOfBoundsException(); |
| 89 | int bytesRead = readBytes(peer, position, b, off, len); |
| 90 | position += bytesRead; |
| 91 | return bytesRead; |
| 92 | } |
| 93 | |
| 94 | public int read(byte b[]) throws IOException { |
| 95 | if(b == null) |