diff --git a/dev/cosbench-driver/src/com/intel/cosbench/driver/generator/RandomInputStream.java b/dev/cosbench-driver/src/com/intel/cosbench/driver/generator/RandomInputStream.java index 0ff4193f..a75a8c9f 100644 --- a/dev/cosbench-driver/src/com/intel/cosbench/driver/generator/RandomInputStream.java +++ b/dev/cosbench-driver/src/com/intel/cosbench/driver/generator/RandomInputStream.java @@ -96,7 +96,7 @@ protected void processBytes(byte[] bytes, int offset, int length) { return; } - int gap = (int) ((processed + length) - (size - hashLen)); + long gap = (processed + length) - (size - hashLen); if (gap > 0) // partial hash needs append in gap area. length -= gap; @@ -122,7 +122,7 @@ protected void processBytes(byte[] bytes, int offset, int length) { } if (gap > 0) - System.arraycopy(hashBytes, 0, bytes, offset, gap); + System.arraycopy(hashBytes, 0, bytes, offset, (int) gap); } }