Package com.amazonaws.test.util
Class InputStreamUtils
- java.lang.Object
-
- com.amazonaws.test.util.InputStreamUtils
-
public class InputStreamUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description InputStreamUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
calculateMD5Digest(InputStream is)
Calculates the MD5 digest for the given input stream and returns it.static byte[]
drainInputStream(InputStream inputStream)
Reads to the end of the inputStream returning a byte array of the contents
-
-
-
Method Detail
-
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
-
-