Beispiel #1
0
 /** 将字符串转换为流 */
 public static InputStream getIsFromStr(String str) {
   InputStream myIn = null;
   try {
     myIn = new ByteArrayInputStream(str.getBytes());
   } catch (Exception e) {
     GLog.e("Error! ");
   }
   return myIn;
 }
Beispiel #2
0
 /** 以文本的形式打印一条数据流 并且返回原数据流 */
 public static InputStream printAndReturnIs(InputStream is, Context ctx) {
   if (DEBUG.DEVELOP_MODE) {
     String result = convertStreamToString(is);
     GLog.i(result);
     return getIsFromStr(result);
   } else {
     return is;
   }
 }