Use compiler defined _WIN32 to test for Windows if it is available.
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.