You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "clesaec (via GitHub)" <gi...@apache.org> on 2023/05/02 12:28:24 UTC

[GitHub] [avro] clesaec commented on a diff in pull request #2203: AVRO-3748 [java] fix SeekableInputStream.skip

clesaec commented on code in PR #2203:
URL: https://github.com/apache/avro/pull/2203#discussion_r1182480339


##########
lang/java/avro/src/main/java/org/apache/avro/file/DataFileReader.java:
##########
@@ -312,10 +312,10 @@ public long skip(long skip) throws IOException {
       long length = in.length();
       long remaining = length - position;
       if (remaining > skip) {
-        in.seek(skip);
+        in.seek(position + skip);
         return in.tell() - position;

Review Comment:
   And in same time, either `return skip; ... else { ... return length - position; }`  either put `return in.tell() - position;` at the end of function.
   



-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org