-
April 20th, 2002, 04:00 PM
#1
Junior Member
counting bits in byte array in Java
Hi,I am currently working on a program to count bits in a byte array with 8 elements in Java. that is actually 64 bits in total.
Of course,I can cast each individual byte to integer,then keeping divide it by 2,get the remainder,until quotient is zero,just
count remainder if remainder is 1.I think it is too messy,is there an easy and efficient way ?
Thanks in advance for help.
nancen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|