if (in) { long pos = in->tellg(); in->seekg(0, std::ios::end); long len = in->tellg(); in->seekg(pos); return len; } else { long pos = out->tellp(); out->seekp(0, std::ios::end); long len = out->tellp(); out->seekp(pos); return len; }
long pos = ftell(f); fseek(f, 0, SEEK_END); long len = ftell(f); fseek(f, pos, SEEK_SET); return len;
	virtual unsigned int getSize()	{		if (in) {			long pos = in->tellg();			in->seekg(0, std::ios::end);			long len = in->tellg();			in->seekg(pos);			return len;		}		else {			long pos = out->tellp();			out->seekp(0, std::ios::end);			long len = out->tellp();			out->seekp(pos);			return len;		}	};