BinaryWriter implements IDisposable for consistency with real APIs.