Another convenience.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2590 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -105,6 +105,15 @@ public class StreamUtil
|
|||||||
return out;
|
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}.
|
* Reads the contents of the supplied stream into a string using the supplied {@link Charset}.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user