I understand that the question is about reading blk files, but why do you need it ? You can ask bitcoin RPC all the data stored in these files.
Well to answer that, first of all, as ETFBitcoin wrote, to understand how it works. Secondly, I was thinking of creating a different block explorer. Right now, block explorers respond with RPC commands and return their result to the client. I was thinking of inserting the blocks' information to a mysql database. This way, RPC is not needed.