   parsing java classfiles - reading a 4 byte unsigned integer
  Hey guys.Im currently writing something to calculate some metrics given a classfile, and am having trouble reading the 4-byte unsigned attribute_count field in one of the structures. How exactly can you go about doing this? The lack of unsigned types in java makes it a bit fiddly.ive been trying int Data1 = Data.readUnsignedInt() ;int Data2 = Data.readUnsignedInt() ;long Final = (Data1 << 16) || (Data2) ;I think this doesn't work because of the high-order bit being interpreted as the sign bit tho. Im not really sure how java stores integer values (2's complement?!) so i dont know where to go from here.any help would be appreciatedScott   
  What you are currently doing doesnt make much sense. But i seam to remeber that you can just read all ints it as a signed Int (according to the class file spec).   ;  You would be able to if it was a normal length signed integer but its not.;  I'm fairly sure ints are 4 bytes in Java. And yes, they are stored 2's complement.   ;  Java int is guaranteed by standard to be exactly 4 bytes of 8 bits each, representing a signed value by 2s complement. I really don't understand how you can know anything about the classfile structure and thus refer to a field labelled "attribute_count", but not know this and be able to figure out how to work with it. Hint: try the *other* chapters in the JLS.   