I have a spec which reads the column specifies a 16 bit offset to a structure and another column specifies a 24 bit offset to a structure. I am implementing the spec using java.
I am not clear of what 16 bit offset /24 bit offset means and how to perform such operation in java.
I have a spec which reads the column specifies a 16 bit offset to
Share
An offset is a relative address in some stream and/or storage medium.
A 16bit offset is an offset that’s stored in a 16 bit variable/slot.
So if some file format specification says that “the next field is the 16 bit offset” that means you must read the next 2 byte and treat it as a relative address.
What exactly that addresses depends on the specification: it might be bytes, it might be “entries” or anything else.
Note also, that Java doesn’t have any built-in 24 bit data types, so you’ll have to work around that using
int, which has 32 bit.