#pragma once
#include <iostream>

class StreamMeasure
{
	std::istream& m_is;
public:
	StreamMeasure(std::istream& is)
			:m_is(is)
	{
		
	}
	unsigned size()
	{
		unsigned last = m_is.tellg();
		m_is.seekg(0,std::ios::end);
		unsigned result = m_is.tellg();
		m_is.seekg(last,std::ios::beg);
		return result;
	}
	unsigned rest()
	{
		unsigned last = m_is.tellg();
		m_is.seekg(0,std::ios::end);
		unsigned result = m_is.tellg();
		m_is.seekg(last,std::ios::beg);
		return result-last;
	}
};
