Index: modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java =================================================================== --- modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java (revision 390448) +++ modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java (working copy) @@ -137,6 +137,9 @@ public long read(long fileDescriptor, byte[] bytes, int offset, int length) throws IOException { + if (bytes == null) { + throw new NullPointerException(); + } long bytesRead = readImpl(fileDescriptor, bytes, offset, length); if (bytesRead < -1) { throw new IOException(); @@ -149,6 +152,9 @@ public long write(long fileDescriptor, byte[] bytes, int offset, int length) throws IOException { + if (bytes == null) { + throw new NullPointerException(); + } long bytesWritten = writeImpl(fileDescriptor, bytes, offset, length); if (bytesWritten < 0) { throw new IOException();