question: private String writeStacksToFile ( Map < String , byte [ ] > dumps , String fileName ) throws IOException { String filePath = null ; OutputStream os = null ; PrintWriter ps = null ; File outputFile = null ; try { outputFile = new File ( fileName ) ; os = new FileOutputStream ( outputFile ) ; ps = new PrintWriter ( os ) ; for ( Map . Entry < String , byte [ ] > entry : dumps . entrySet ( ) ) { ps . append ( "*** Stack-trace for member " + entry . getKey ( ) + " ***" ) ; ps . flush ( ) ; GZIPInputStream zipIn = new GZIPInputStream ( new ByteArrayInputStream ( entry . getValue ( ) ) ) ; BufferedInputStream bin = new BufferedInputStream ( zipIn ) ; byte [ ] buffer = new byte [ 10000 ] ; int count ; while ( ( count = bin . read ( buffer ) ) != - 1 ) { os . write ( buffer , 0 , count ) ; } ps . append ( '\n' ) ; } ps . flush ( ) ; filePath = outputFile . getCanonicalPath ( ) ; } finally { os . close ( ) ; } return filePath ; }
target:  Writes the Stack traces member-wise to a text file