用in.read()是是有没有数据,也可能是in.available()的问题。

解决方案 »

  1.   

    确实很有可能是weblogic的问题。大家一起来奇怪!哈哈
      

  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. 
    Returns:
    the number of bytes that can be read from this input stream without blocking. 
    Throws: 
    IOException - if an I/O error occurs.available()方法是这么定义的,The available method for class InputStream always returns 0. 是什么意思?
    为什么我换个url就能得到这个available值?
      

  3.   

    我使用过System.in.available()也都是0,除非调用了System.in.read(),以后如果还有数据没有读入才有数据,我觉得是个Bug
      

  4.   

    你可以先调用in.read()读一个字节,然后再调用
    in.available()看看是几,说不定就不是0了。