code: 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;
      }
docs: Reads the contents of the given stream.
  @param stream The input stream of the file
  @return <CODE>true</CODE> if the file was read successfully
  @throws IOException The file could not be opened