Java 报错为The operator & is undefined for the argument type(s) byte[], int,程序如下,请教怎么办
privateStringbytesToHexStr(byte[]b){//TODOAuto-generatedmethodstubif(b==null)returnnu...
private String bytesToHexStr(byte[] b) {
// TODO Auto-generated method stub
if (b == null) return null;
StringBuffer strBuffer = new StringBuffer(b.length * 3);
for(int i = 0; i < b.length; i++)
{
strBuffer.append(Integer.toHexString(b & 0xff));
strBuffer.append(" ");
}
return strBuffer.toString();
} 展开
// TODO Auto-generated method stub
if (b == null) return null;
StringBuffer strBuffer = new StringBuffer(b.length * 3);
for(int i = 0; i < b.length; i++)
{
strBuffer.append(Integer.toHexString(b & 0xff));
strBuffer.append(" ");
}
return strBuffer.toString();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询