opwvhk commented on code in PR #2984:
URL: https://github.com/apache/avro/pull/2984#discussion_r1657115871
##########
lang/java/avro/src/main/java/org/apache/avro/file/SeekableByteArrayInput.java:
##########
@@ -34,8 +35,12 @@ public long length() throws IOException {
@Override
public void seek(long p) throws IOException {
- this.reset();
- this.skip(p);
+ if (p >= this.count) {
+ throw new EOFException();
+ }
+ if (p >= 0) {
+ this.pos = (int) p;
+ }
Review Comment:
A bit longer this way, but the original would go wrong when `mark()` was
ever called.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]