public boolean read ( InputStream stream ) throws IOException { valid = false ; InputStreamReader reader = new InputStreamReader ( stream ) ; // Load the file contents contents = getContents ( reader , "\n" ) ; if ( contents != null ) valid = true ; else logger . severe ( "Unable to read file contents: " + filename ) ; try { if ( reader != null ) reader . close ( ) ; } catch ( IOException e ) { } return valid ; }
Reads the contents of the given stream .