static String readString ( final InputStream is ) { try ( final Scanner s = new Scanner ( is , "UTF-8" ) ) { s . useDelimiter ( "\\A" ) ; if ( s . hasNext ( ) ) { return s . next ( ) ; } else { return "" ; } } }
Reads a string from an input stream .