java - Convert byte[] to UnsignedByte[] -
i want optimize following java code (a single method):
private static unsignedbyte[] getunsignedbytes(byte[] bytes){ unsignedbyte[] usbytes = new unsignedbyte[bytes.length]; int f; for(int = 0; i< bytes.length;i++){ f = bytes[i] & 0xff; usbytes[i] = new unsignedbyte(f) ; } return usbytes; }
this code converts byte array(which file) unsignedbyte array can send webservice consuming through apache axis.
is there way can avoid loop. there direct method this?
thank you.
no, unfortunately there not. conversion of array of bytes has done element.
Comments
Post a Comment