×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Karthick Bala
Added: Jul 25, 2014 10:27 AM
Views: 8
Tags: no tags
  1.    public static String byteToString(ByteArrayInputStream inputReader){
  2.        if(inputReader == null){
  3.            return null;
  4.        }
  5.         inputReader.reset();
  6.         int c;
  7.         StringWriter sWriter = new StringWriter();
  8.         while((c=inputReader.read())!=-1){
  9.             sWriter.write(c);
  10.         }
  11.         inputReader.reset();
  12.         return sWriter.toString();
  13.   }