What do you really need to do (hex number is a bit generic, maybe, for instance, a byte, a 16-bit number... Please note: hex is only a number representation base)? Maybe you need to: (1) open the stream in binary mode. (2) use the method read( unsigned char* puch, int nCount ) to get the relevant bytes. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.