> +      while (offset < length) {
> +         blockCount++;
> +         long chunkSize = MAX_BLOCK_SIZE;
> +         if (blockCount >= totalBlocks) {
> +            chunkSize = length % MAX_BLOCK_SIZE;
> +         }
> +         bytesWritten += chunkSize;
> +         Payload block = slicer.slice(payload, offset, chunkSize);
> +         offset += MultipartUploadStrategy.MAX_BLOCK_SIZE;
> +         String blockName = blobName + "-" + offset + "-" + new 
> SecureRandom().nextInt();
> +         byte blockIdBytes[] = 
> Hashing.md5().hashBytes(blockName.getBytes()).asBytes();
> +         String blockId = BaseEncoding.base64().encode(blockIdBytes);
> +         blockIds.add(blockId);
> +         client.putBlock(container, blobName, blockId, block);
> +      }
> +      assert(bytesWritten == length);

Should be fixed in next PR

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/52/files#r5155191

Reply via email to