Another convenience.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2590 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2009-07-12 21:24:48 +00:00
parent 0711e29d39
commit be689f7135
@@ -105,6 +105,15 @@ public class StreamUtil
return out;
}
/**
* Reads the contents of the supplied stream into a byte array.
*/
public static byte[] toByteArray (InputStream stream)
throws IOException
{
return copy(stream, new ByteArrayOutputStream()).toByteArray();
}
/**
* Reads the contents of the supplied stream into a string using the supplied {@link Charset}.
*/