question: protected String streamToString ( InputStream in , String charset ) throws IOException { InputStreamReader reader = new InputStreamReader ( in , charset ) ; StringBuilder buffer = new StringBuilder ( ) ; char [ ] chars = new char [ 1024 ] ; int n ; while ( ( n = reader . read ( chars , 0 , chars . length ) ) != - 1 ) { buffer . append ( chars , 0 , n ) ; } return buffer . toString ( ) ; }
target:  Gets the data from the specified input stream as a string using the specified charset. TODO: make these commands as part of a generic helper class in Cargo. Duplicate function in the Tomcat remote deployer