Skip to content

Commit

Permalink
implement available. (Azure#27907)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasobol-msft authored Mar 28, 2022
1 parent d108c7d commit 8218284
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package com.azure.perf.test.core;

import java.io.IOException;
import java.io.InputStream;
import java.util.Random;

Expand Down Expand Up @@ -84,5 +85,15 @@ public boolean markSupported() {
public synchronized void reset() {
this.pos = this.mark;
}

@Override
public int available() throws IOException {
long remaining = this.size - this.pos;
if (remaining > Integer.MAX_VALUE) {
return Integer.MAX_VALUE;
} else {
return (int) remaining;
}
}
}

0 comments on commit 8218284

Please sign in to comment.