ignore redundant calls to File{In|Out}putStream.close

Previously, we threw an IOException, which did not match Sun's behavior.
This commit is contained in:
Joel Dice 2010-01-09 18:22:16 -07:00
parent 9a056da2f7
commit 585dba004b
2 changed files with 8 additions and 4 deletions

View File

@ -55,7 +55,9 @@ public class FileInputStream extends InputStream {
} }
public void close() throws IOException { public void close() throws IOException {
close(fd); if (fd != -1) {
fd = -1; close(fd);
fd = -1;
}
} }
} }

View File

@ -55,7 +55,9 @@ public class FileOutputStream extends OutputStream {
} }
public void close() throws IOException { public void close() throws IOException {
close(fd); if (fd != -1) {
fd = -1; close(fd);
fd = -1;
}
} }
} }