public class FileChooser extends JFrame{ 
File file = chooser.getSelectedFile();}
这是一个监听器用于选择文件。。中间就省略了。。得到file然后是主类
public class AAAAA {
public static void main(String[] args) throws Exception {

DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = domfac.newDocumentBuilder();

new FileChooser().setVisible(true); 

InputStream is = new FileInputStream();
Document doc = builder.parse(is);}
因为分析XML必须要转成输入流。。就想求一下 如何在这里把file成功的转成 is 输入流一直弄不成功。。所以来求教下
非常感谢