Polish DataBufferInputStream.skip()

See gh-34799
Closes gh-35030

Signed-off-by: Johnny Lim <izeye@naver.com>
This commit is contained in:
Johnny Lim
2025-06-11 22:10:49 +09:00
committed by Brian Clozel
parent 26ae3ed8d4
commit 722333f0f1

View File

@@ -124,7 +124,7 @@ final class DataBufferInputStream extends InputStream {
return 0L;
}
int skipped = Math.min(available(), n > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) n);
this.dataBuffer.readPosition(Math.min(this.end, this.dataBuffer.readPosition() + skipped));
this.dataBuffer.readPosition(this.dataBuffer.readPosition() + skipped);
return skipped;
}