Use standards compliant _WIN32 to test for Windows.
Throw objects derived from std::exception rather than throwing c-style strings.
Add error numbers to messages to distinguish between identical error message texts.
  (ex: "buffer too short")
Hand code byteswap16().  The intrinsic is not available on gcc 4.7 which is still in common use.
Use integer limits INT_MIN, INT_MAX rather than literals.  Buglet in VC won't let you express INT_MIN literally.