> @@ -42,6 +50,76 @@
> */
> @Singleton
> public class BasePayloadSlicer implements PayloadSlicer {
> +
> + public static class PayloadIterator implements Iterable<Payload>,
> Iterator<Payload> {
> +
> + private final InputStream input;
> + private final ContentMetadata metaData;
> + private Payload nextPayload;
> + private final int readLen;
> +
> + public PayloadIterator(InputStream input, ContentMetadata meta) {
> + this.input = checkNotNull(input, "input");
> + this.metaData = checkNotNull(meta, "meta");
> + this.readLen = this.metaData.getContentLength().intValue();
`getContentLength()` [is
nullable](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/io/ContentMetadata.java#L55),
so we would either need a checkNotNull or some null handling here.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/192/files#r7291407