public int available()
   Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. The next caller might be the same thread or or another thread.
  请注意下面这句话:  
    The available method for class InputStream always returns 0. 
    如果你想看输入流的大小,就用read()方法把数据读到一个byte[]中,然后看它数组的大小.

解决方案 »

  1.   

    大兵,试试介个!
    InputStreamReader aa = new InputStreamReader(ps.getOutputStream());
      

  2.   

    public int available()
                  throws IOException
    Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. The next caller might be the same thread or or another thread. The available method for class InputStream always returns 0. <---------看!This method should be overridden by subclasses. 必须用他的继承类才可以!否则总是返回0!!
      

  3.   

    overridden是override的过去分词override
    vt.
    制服, 践踏, 奔越过, 蹂躏, 不顾, 不考虑(某人的意见,决定,愿望等)
    n.
    代理佣金
      

  4.   

    你们两个闹事阿 !!!
    综合楼上几位大哥的意见,终于解决了,高兴!方法如下:
    String cmd="";
    cmd="exp test/test@ning file=c:\1.dmp";
    Runtime runtime=Runtime.getRuntime();
    try
    {
    aa=ps.getInputStream(); 
    BufferedReader it=new BufferedReader(new InputStreamReader(aa));
    String haha="";
    while((haha=it.readLine())!=null)
     {
             System.out.println(haha); 
    }}catch(IOException ex)
    {
      System.out.println("Exception =====>"+ex.toString());
    }