question: private String readResourceAsString ( Resource resource ) throws IOException { StringBuilder contents = new StringBuilder ( ) ; Reader reader = new InputStreamReader ( resource . asStream ( ) , "UTF-8" ) ; try { char buffer [ ] = new char [ 8192 ] ; int length ; while ( ( length = reader . read ( buffer ) ) != - 1 ) { contents . append ( buffer , 0 , length ) ; } } finally { reader . close ( ) ; } return contents . toString ( ) ; }
target:  Reads the entire contents of the given resource as a String. The resource is assumed to be encoded in UTF-8.