FileInputStream in = new FileInputStream("file");
byte[] buf = new byte[in.avilable()];
in.read(buf);
in.close();OutputStream os = response.getOutputStream();
os.write(buf);
os.close();---------------
[email protected]

解决方案 »

  1.   

    /**汉字内码转换
     * @param String str
     *
     * */
      public static String getStr(String strIn)
        {
            if(chkString(strIn)){return strIn;}        try{
                String temp_p=strIn;
                byte[] temp_t = temp_p.getBytes("GBK");
                String temp  = new String(temp_t,"ISO 8859-1");
                return temp;        }catch(UnsupportedEncodingException e){
                return strIn;
            }
        }
      

  2.   

    /**汉字内码转换
     * @param String str
     *
     * */
      public static String getStr(String strIn)
        {        try{
                String temp_p=strIn;
                byte[] temp_t = temp_p.getBytes("GBK");
                String temp  = new String(temp_t,"ISO 8859-1");
                return temp;        }catch(UnsupportedEncodingException e){
                return strIn;
            }
        }