kopia lustrzana https://github.com/gaul/s3proxy
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.pull/95/head
rodzic
50a3024362
commit
732ef5d260
|
@ -481,9 +481,6 @@ public final class S3ProxyTest {
|
|||
|
||||
for (int i = 0; i < numParts; ++i) {
|
||||
ByteSource partByteSource = byteSource.slice(i, 1);
|
||||
// TODO: wrap sliced byte source to work around zero length bug
|
||||
partByteSource = ByteSource.wrap(partByteSource.read());
|
||||
assertThat(partByteSource.size()).isEqualTo(1); // TODO:
|
||||
Payload payload = Payloads.newByteSourcePayload(partByteSource);
|
||||
payload.getContentMetadata().setContentLength(
|
||||
partByteSource.size());
|
||||
|
|
|
@ -75,7 +75,8 @@ final 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
|
||||
|
|
Ładowanie…
Reference in New Issue