Skip to content

Commit 7ec3ff1

Browse files
committed
Fixed ByteArrayInputStream.peek implementation (previous one could lead to unexpected behavior on skip(n))
1 parent 124452f commit 7ec3ff1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ public int available() throws IOException {
163163
}
164164

165165
public int peek() throws IOException {
166-
this.peek = readWithinBlockBoundaries();
166+
if (peek == null) {
167+
peek = readWithinBlockBoundaries();
168+
}
167169
return peek;
168170
}
169171

0 commit comments

Comments
 (0)