mirror of https://github.com/apache/jclouds.git
Correct RandomByteSource.read return value
Previously read returned a value between -128 and 127. -1 indicates end of stream, causing issues for callers. Instead return values between 0 and 255 as intended.
This commit is contained in:
parent
89e102810e
commit
11640b6c2e
|
@ -70,7 +70,8 @@ public class TestUtils {
|
|||
if (closed) {
|
||||
throw new IOException("Stream already closed");
|
||||
}
|
||||
return (byte) random.nextInt();
|
||||
// return value between 0 and 255
|
||||
return random.nextInt() & 0xff;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue