Skip to content

Commit

Permalink
8276164: RandomAccessFile#write method could throw IndexOutOfBoundsEx…
Browse files Browse the repository at this point in the history
…ception that is not described in javadoc
  • Loading branch information
Yano, Masanori committed Oct 29, 2021
1 parent bf4b0e2 commit 1de8526
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/java.base/share/classes/java/io/DataOutput.java
Expand Up @@ -92,6 +92,9 @@ public interface DataOutput {
* @param off the start offset in the data.
* @param len the number of bytes to write.
* @throws IOException if an I/O error occurs.
* @throws IndexOutOfBoundsException If {@code off} is negative,
* {@code len} is negative, or {@code len} is greater than
* {@code b.length - off}
*/
void write(byte[] b, int off, int len) throws IOException;

Expand Down
4 changes: 1 addition & 3 deletions src/java.base/share/classes/java/io/RandomAccessFile.java
Expand Up @@ -553,9 +553,7 @@ public void write(byte[] b) throws IOException {
* @param off the start offset in the data.
* @param len the number of bytes to write.
* @throws IOException if an I/O error occurs.
* @throws IndexOutOfBoundsException If {@code off} is negative,
* {@code len} is negative, or {@code len} is greater than
* {@code b.length - off}
* @throws IndexOutOfBoundsException {@inheritDoc}
*/
public void write(byte[] b, int off, int len) throws IOException {
writeBytes(b, off, len);
Expand Down

0 comments on commit 1de8526

Please sign in to comment.