Sometimes the platform default charset is appropriate. Like when you're turning
the results of Process.getOutputStream() into a string. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2592 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -114,6 +114,15 @@ public class StreamUtil
|
|||||||
return copy(stream, new ByteArrayOutputStream()).toByteArray();
|
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}.
|
* Reads the contents of the supplied stream into a string using the supplied {@link Charset}.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user