[fix][offload] Fix numerical overflow bug while reading data from tiered storage
@@ -182,6 +182,7 @@ public class BlobStoreBackedInputStreamImpl extends BackedInputStream {
@Override
public int available() throws IOException {
- return (int) (objectLen - cursor) + buffer.readableBytes();
+ long available = objectLen - cursor + buffer.readableBytes();
+ return available > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) available;
}
}
