38 |
|
|
39 |
package java.io; |
package java.io; |
40 |
|
|
|
import gnu.classpath.Configuration; |
|
41 |
import java.nio.channels.FileChannel; |
import java.nio.channels.FileChannel; |
42 |
import gnu.java.nio.FileChannelImpl; |
import gnu.java.nio.FileChannelImpl; |
43 |
|
|
46 |
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com. |
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com. |
47 |
* Status: Believed complete and correct. |
* Status: Believed complete and correct. |
48 |
*/ |
*/ |
49 |
|
|
50 |
/** |
/** |
51 |
* This class is a stream that reads its bytes from a file. |
* This class is a stream that reads its bytes from a file. |
52 |
* |
* |
143 |
if (s != null) |
if (s != null) |
144 |
s.checkRead(fdObj); |
s.checkRead(fdObj); |
145 |
|
|
146 |
this.fd = fdObj; |
fd = fdObj; |
147 |
} |
} |
148 |
|
|
149 |
/** |
/** |
255 |
*/ |
*/ |
256 |
public int read(byte[] buf, int offset, int len) throws IOException |
public int read(byte[] buf, int offset, int len) throws IOException |
257 |
{ |
{ |
258 |
if (off < 0 || len < 0 || off + len > b.length) |
if (offset < 0 |
259 |
|
|| len < 0 |
260 |
|
|| offset + len > buf.length) |
261 |
throw new ArrayIndexOutOfBoundsException(); |
throw new ArrayIndexOutOfBoundsException(); |
262 |
|
|
263 |
return fd.read(buf, offset, len); |
return fd.read(buf, offset, len); |