Skip to content

Commit a257ee4

Browse files
committed
Improve IndexOutOfBoundsException message
1 parent 64d6c7f commit a257ee4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

parquet-encoding/src/main/java/parquet/bytes/CapacityByteArrayOutputStream.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ public void write(int b) {
128128
public void write(byte b[], int off, int len) {
129129
if ((off < 0) || (off > b.length) || (len < 0) ||
130130
((off + len) - b.length > 0)) {
131-
throw new IndexOutOfBoundsException(String.format("len: %d, off: %d", len, off));
131+
throw new IndexOutOfBoundsException(
132+
String.format("Given byte array of size %d, with requested length(%d) and offset(%d)", b.length, len, off));
132133
}
133134
if (currentSlabIndex + len >= currentSlab.length) {
134135
final int length1 = currentSlab.length - currentSlabIndex;

0 commit comments

Comments
 (0)