Skip to content
Permalink
Browse files
8276164: RandomAccessFile#write method could throw IndexOutOfBoundsEx…
…ception that is not described in javadoc

Reviewed-by: alanb
  • Loading branch information
Masanori Yano authored and Alan Bateman committed Nov 2, 2021
1 parent 0488ebd commit 9bf31652cbe8eb2699babe5e52e62ea1f1578588
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -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;

@@ -553,6 +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 {@inheritDoc}
*/
public void write(byte[] b, int off, int len) throws IOException {
writeBytes(b, off, len);

1 comment on commit 9bf3165

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 9bf3165 Nov 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.