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

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -