/*
 * Copyright (c) 2016 EMC Corporation. All Rights Reserved.
 */
package com.emc.ia.sdk.support.io;

import java.io.IOException;
import java.io.InputStream;
import java.util.function.Supplier;

import org.apache.commons.io.IOUtils;


/**
 * Provide repeatable access to the same {@linkplain InputStream} by caching it in memory.
 */
public class RepeatableInputStream implements Supplier<InputStream> {

  private final ByteArrayInputOutputStream provider = new ByteArrayInputOutputStream();

  /**
   * Provide repeatable access to the given input stream.
   * @param source The input stream to make available for repeated access
   * @throws IOException When an I/O error occurs
   */
  public RepeatableInputStream(InputStream source) throws IOException {
    IOUtils.copy(source, provider);
  }

  @Override
  public InputStream get() {
    return provider.getInputStream();
  }

}

@@ -152,16 +152,42 @@
 Stream;%0A
+import java.util.Objects;%0A
 import j
@@ -651,16 +651,47 @@
 d access
+. Must not be %3Ccode%3Enull%3C/code%3E
 %0A   * @t
@@ -828,22 +828,46 @@
 ls.copy(
+Objects.requireNonNull(
 source
+)
 , provid

Add check for null parameter