Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

converting bytes to unsigned bytes

807603Jan 9 2008 — edited Jan 10 2008
      int u=0;
      int i=32;

 byte []  data1 = new byte[1024];
 int[] unsignedValue=new int[1024];

while(u<100){
                   
                    unsignedValue[u] =data1[i] & 0xff;

                      u++;
                      i++;
                   } 
from input stream iam storing bytes in data1.now i want to convert specific bytes to unsigned bytes.

here i tryed in the above way but i want to convert
2 to 8
12 to 18
22 to 28
bytes to unsigned and i want to store how can i do this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2008
Added on Jan 9 2008
14 comments
339 views