Fix InputStream violation in DataBufferInputStream

This commit fixes an issue in DataBufferInputStream::mark, which before
did not follow the contract defined by InputStream.

Closes gh-29642
This commit is contained in:
Arjen Poutsma
2022-12-07 15:23:19 +01:00
parent c79474d269
commit 92a6e7ddcd
2 changed files with 12 additions and 2 deletions

View File

@@ -77,8 +77,9 @@ final class DataBufferInputStream extends InputStream {
}
@Override
public void mark(int mark) {
this.mark = mark;
public void mark(int readLimit) {
Assert.isTrue(readLimit > 0, "readLimit must be greater than 0");
this.mark = this.dataBuffer.readPosition();
}
@Override