diff --git a/src/java/com/samskivert/io/StreamUtil.java b/src/java/com/samskivert/io/StreamUtil.java index 2ee5c7ea..8315ff97 100644 --- a/src/java/com/samskivert/io/StreamUtil.java +++ b/src/java/com/samskivert/io/StreamUtil.java @@ -114,6 +114,15 @@ public class StreamUtil return copy(stream, new ByteArrayOutputStream()).toByteArray(); } + /** + * Reads the contents of the supplied stream into a string using the platform default charset. + */ + public static String toString (InputStream stream) + throws IOException + { + return copy(stream, new ByteArrayOutputStream()).toString(); + } + /** * Reads the contents of the supplied stream into a string using the supplied {@link Charset}. */