Index: trunk/modules/luni/src/main/java/java/io/FileInputStream.java =================================================================== --- trunk/modules/luni/src/main/java/java/io/FileInputStream.java (revision 429933) +++ trunk/modules/luni/src/main/java/java/io/FileInputStream.java (working copy) @@ -272,7 +272,11 @@ * occurs. */ public int read(byte[] buffer, int offset, int count) throws IOException { - if (count < 0 || offset < 0 || offset > buffer.length + if (buffer == null) { + throw new NullPointerException(org.apache.harmony.luni.util.Msg + .getString("K0047")); + } + if (count < 0 || offset < 0 || offset > buffer.length || count > buffer.length - offset) { throw new IndexOutOfBoundsException(); }