I'm trying to read some data from a disk file created by a third party
application (written I think in C), so I don't have any option other
than to read/interpret the data in the format in which it's been
saved. There's one particular field giving me problems:
The problematic data item is a 2-byte field saved as an unsigned
integer and has two problems:
1. I know that I can't read a uint directly in to VB.Net (Framework
1.1 at least) as a native type. But presumably there's nothing
stopping me reading it as a short and (?) subtracting 32768 to get the
original value? But see also the next problem:
2. The 2-byte field is actually holding two data items. The most
significant nybble (which I presume is the top 4 bits) holds one (say
A), with the remaining 12 bits (?) holding the other (B). I have some
documentation that suggests retrieving these values by using:
A = uint & 0xF000
B = uint & 0x0FFF
But I must admit to being stuck as to how to implement these in
VB.Net. I'm guessing that it should be possible to do this either
directly or with a workaround, but what?
Any help much appreciated.
JGD