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

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

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -