Skip to content

Commit 31a1848

Browse files
committed
Backported "fixed EOF handling by ByteArrayInputStream::fill" from master@89d64eb
1 parent 7efa961 commit 31a1848

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/github/shyiko/mysql/binlog/io/ByteArrayInputStream.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public void fill(byte[] bytes, int offset, int length) throws IOException {
9494
int remaining = length;
9595
while (remaining != 0) {
9696
int read = read(bytes, offset + length - remaining, remaining);
97+
if (read == -1) {
98+
throw new EOFException();
99+
}
97100
remaining -= read;
98101
}
99102
}

0 commit comments

Comments
 (0)