前台winform,后台java代码是:
OutputStream ou=(OutputStream)response.getOutputStream();
ou.write(rightSet.getRight(user, fund,type,role).getBytes(YssCons.ENCODING));
当rightSet.getRight(user, fund,type,role)返回为空时,
win7,前台返回http.responseBody为null,
XMLHTTP http = new XMLHTTP();
if (http.status != 200)
{
throw new ClsException("(" + http.status + ")" + (http.status == 404 ? "找不到或无法访问" : "") + http.statusText);
}
else if (http.responseBody != null)
{
//l_ReturnObject =Decompression((Stream)new MemoryStream((byte[])http.responseBody));
l_ReturnObject = encode((byte[])http.responseBody, encoding);
}
win10,前台返回http.responseBody为byte[0](空数组),
因此,导致l_ReturnObject 返回"",出现了异常。