rt,谢谢。

解决方案 »

  1.   

    InputStream是一个流类型阿,你可以读出来放到bytes[]数组中,然后new String(bytes[])就可以了阿
      

  2.   

    把InputStream里面的数据先读出来放到byte数组里,然后再转成String
      

  3.   

    InputStream是输入流,可以直接打印出来,也可以放在数组中,对数组进行转换。
      

  4.   

    public String inputStream2String (InputStream in) throws IOException {
        StringBuffer out = new StringBuffer();
        byte[] b = new byte[4096];
        for (int n; (n = in.read(b)) != -1;) {
            out.append(new String(b, 0, n));
        }
        return out.toString();
    }
      

  5.   

    用下面这个吧

    public static String inputStream2String(InputStream is) throws IOException{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    int i=-1;
    while((i=is.read())!=-1){
    baos.write(i);
    }
    return baos.toString();
    }
      

  6.   

    public String inputStream2String (InputStream in) throws IOException {
        StringBuffer out = new StringBuffer();
        byte[] b = new byte[4096];
        for (int n; (n = in.read(b)) != -1;) {
            out.append(new String(b, 0, n));
        }
        return out.toString();
    }

    public static String inputStream2String(InputStream is) throws IOException{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    int i=-1;
    while((i=is.read())!=-1){
    baos.write(i);
    }
    return baos.toString();
    }
    都行得通
    哈哈