Class InputStreamUtils

java.lang.Object
com.amazonaws.test.util.InputStreamUtils

public class InputStreamUtils extends Object
  • Constructor Details

    • InputStreamUtils

      public InputStreamUtils()
  • Method Details

    • calculateMD5Digest

      public static byte[] calculateMD5Digest(InputStream is) throws NoSuchAlgorithmException, IOException
      Calculates the MD5 digest for the given input stream and returns it.
      Throws:
      NoSuchAlgorithmException
      IOException
    • drainInputStream

      public static byte[] drainInputStream(InputStream inputStream)
      Reads to the end of the inputStream returning a byte array of the contents
      Parameters:
      inputStream - InputStream to drain
      Returns:
      Remaining data in stream as a byte array