There are dozens of network protocols and file formats (WAV, TCP, BMP, etc. etc.)
Is there a solution available to create an abstraction layer between the implementation of a protocol and the code that uses the resulting data?
Take a WAV file. A software component could contain logic to identify chucks and parse them into classes. The user of this component would not need to know whether the number of channels is stored in two or four bytes.
The WAV file format specification is not all the different from hundreds of other formats and protocols, so why not make a generic solution? To create an even better abstraction, the protocol specification could be stored in XML. I've had no luck finding anything like this. Can you point me in the right direction?
EDIT: This clearly is not a problem that is easily communicated over a post. The current answers are not really what I'm looking for, but I'd like to thank everyone for at least giving it a shot.