JDK1.4上HTTP请求后,无返回数据(但是小弟我把代码放到JDK1.6的环境上就行),求大家帮忙看上,谢了~

JDK1.4下HTTP请求后,无返回数据(但是我把代码放到JDK1.6的环境下就行),求大家帮忙看下,谢了~~~~

in = urlCon.getInputStream();
DataInputStream din = new DataInputStream(in);
byte [] btArr = new byte [1024];
int i = 0;
while ( true )
{
    if ( i >= btArr.length )
    {
         byte [] temp = new byte [1024 + i];
         System.arraycopy( btArr , 0 , temp , 0 , btArr.length ) ;
         btArr = temp ;
    }
    try
    {
         btArr [i] = din.readByte();
    }
    catch ( Exception e )
    {
        break;
    }
     i++;
}
byte [] ctArr = new byte [ i ] ;
System.arraycopy( btArr , 0 , ctArr , 0 , ctArr.length ) ;
                 
inMsg = new String( ctArr , "UTF-8" ) ;
System.out.println( inMsg ) ;

------解决方案--------------------
测试类下jdk级别设置为1.4没有问题

/**
 * @param args
 */
public static void main(String[] args) {
// TODO Auto-generated method stub
File f = new File("E:\\test.txt");  
    InputStream in = null;
try {
in = new FileInputStream(f);
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}  
DataInputStream din = new DataInputStream(in);
byte[] btArr = new byte[1024];
int i = 0;
while (true) {
if (i >= btArr.length) {
byte[] temp = new byte[1024 + i];
System.arraycopy(btArr, 0, temp, 0, btArr.length);
btArr = temp;
}
try {
btArr[i] = din.readByte();
} catch (Exception e) {
break;
}
i++;
}
byte[] ctArr = new byte[i];
System.arraycopy(btArr, 0, ctArr, 0, ctArr.length);

String inMsg;
try {
inMsg = new String(ctArr, "UTF-8");
System.out.println(inMsg);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

------解决方案--------------------
引用:
Java code?123456789101112131415161718192021222324252627in = urlCon.getInputStream();DataInputStream din = new DataInputStream(in);byte [] btArr = new byte [1024];int i = 0;while ( true ){……