I use the following method to get all .class files from an eclipse project. but the returned files are in InputStream format which I can not get the content.
public void setFileList(IContainer container) throws CoreException, IOException {
       IResource [] members = container.members();
       for (IResource member : members) {
          if (member instanceof IContainer)  {
              setFileList((IContainer)member);
           } else if (member instanceof IFile && member.isDerived()) {
               IFile file = (IFile)member;
               InputStream contents = file.getContents();
               this.fileList.add(contents);
           }
        }
    }
How can I get the contents of this InputStream in a string format or a txt file?
 
    