toHexString(byte[]) cannot be applied to (byte)

hi, i encountered an error like this:

toHexString(byte[]) cannot be applied to (byte)

publicstatic String toHexString(byte[] msg){

StringBuffer buffer =new StringBuffer();

if (msg !=null){

for (int i = 0; i < msg.length; i++)

buffer.append(toHexString(msg[i]) );// error occurred here

return buffer.toString();

}else{

return"NOTHING";

}

}

any advice is appreciatedly.thanks in advance

[1058 byte] By [kenneth-rocka] at [2007-11-27 11:30:19]
# 1

You can't pass a single byte to a method that defines to take a byte array.

CeciNEstPasUnProgrammeura at 2007-7-29 16:33:05 > top of Java-index,Java Essentials,Java Programming...