//Read in the bytes (why do they read char instead of byte?) char tagSize = br.ReadChars(4); // I use this to read the bytes in from the file //Store the shifted bytes (why is it int, not byte?) int bytes = new int; // for bit shifting int size = 0; // for the final number /* * Why are they combining these bytes in this way if they're * going to again combine them below (in the line setting "size")? */ //how do they know they only care about the rightmost bit on the 3rd byte? //how do they know to shift it 7 to the left? bytes = tagSize | ((tagSize & 1) << 7) ; //Why do they use 63 here (I know it's 111111)? //how do they know they only want the 3 rightmost of byte 2nd byte? //And how know to shift it 6 to the left? bytes = ((tagSize >> 1) & 63) | ((tagSize & 3) << 6) ; bytes = ((tagSize >> 2) & 31) | ((tagSize & 7) << 5) ; bytes = ((tagSize >> 3) & 15) ; //how do they know to shift these bytes the amount that they do to the left? size = ((UInt64)bytes | ((UInt64)bytes << 8) | ((UInt64)bytes << 16) | ((UInt64)bytes << 24)) ;
6tr6tr wrote:Absolute rubbish. Here a couple of links for you:
You've GOT to be kidding! I posted only ONCE on THIS forum. Javaranch is owned by a different company and does NOT have all the same members that this web forum has. Posting the same question on completely different websites' forums is NOT cross-posting. Cross-posting is posting the same thing in different boards of ONE website's forums.