Merged gcj-eclipse branch to trunk.

From-SVN: r120621
This commit is contained in:
Tom Tromey 2007-01-09 19:58:05 +00:00
parent c648dedbde
commit 97b8365caf
17478 changed files with 606493 additions and 100744 deletions

View file

@ -38,8 +38,9 @@ exception statement from your version. */
package java.io;
import gnu.java.nio.channels.FileChannelImpl;
import gnu.java.nio.FileChannelImpl;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
@ -107,7 +108,20 @@ public class FileInputStream extends InputStream
if (s != null)
s.checkRead(file.getPath());
ch = FileChannelImpl.create(file, FileChannelImpl.READ);
try
{
ch = FileChannelImpl.create(file, FileChannelImpl.READ);
}
catch (FileNotFoundException fnfe)
{
throw fnfe;
}
catch (IOException ioe)
{
FileNotFoundException fnfe = new FileNotFoundException(file.getPath());
fnfe.initCause(ioe);
throw fnfe;
}
}
/**
@ -266,7 +280,7 @@ public class FileInputStream extends InputStream
|| offset + len > buf.length)
throw new ArrayIndexOutOfBoundsException();
return ch.read(buf, offset, len);
return ch.read(ByteBuffer.wrap(buf, offset, len));
}
/**