[Schmitzm-commits] r1651 - trunk/schmitzm-core/src/main/java/de/schmitzm/io

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jul 26 20:14:57 CEST 2011


Author: alfonx
Date: 2011-07-26 20:14:56 +0200 (Tue, 26 Jul 2011)
New Revision: 1651

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java
Log:


Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java	2011-07-26 17:17:09 UTC (rev 1650)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java	2011-07-26 18:14:56 UTC (rev 1651)
@@ -1511,8 +1511,16 @@
 		return convertStreamToString(is,"UTF-8");
 	}
 	
+	/**
+	 * Read a (not too big) Inputtream directly into a String.
+	 * 
+	 * @param is
+	 *            {@link InputStream} to read from
+	 */
 	public static String convertStreamToString(InputStream is, String charset)
 			throws IOException {
+		
+		if (charset == null ) charset= "UTF-8";
 		/*
 		 * To convert the InputStream to String we use the Reader.read(char[]
 		 * buffer) method. We iterate until the Reader return -1 which means



More information about the Schmitzm-commits mailing list