Just to ensure I'm getting this right: we accumulate the value of successive
reads in the offset until read == -1. Then we either return null if offset ==
0, else we create a payload. I.e. is this equivalent to:
```
int offset = 0;
while ((read = input.read(content, offset, readLen - offset) != -1) {
offset += read;
}
if (offset == 0) {
return null;
} else if (offset < content.length) {
return createPayload(Arrays.copyOf(content, offset));
} else {
return createPayload(content);
}
```
(or alternatively)
```
...
if (offset == 0) {
return null;
}
return createPayload((content.length == offset) ? content :
Arrays.copyOf(content, offset));
```
If that would also be correct, do you think that would be easier to read?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/commit/d43c3ea3e0e31663657bb8d99209a3535b5bfcc6#commitcomment-6877993