63 std::fstream::pos_type position_insert, position_eof;
66 position_insert = str.tellg();
67 str.seekg(0, std::ios::end);
68 position_eof = str.tellg();
72 length =
static_cast<int>(position_eof - position_insert);
75 std::vector<char> trybuf(length);
79 str.seekg(position_insert);
82 str.read(trybuf.data(), length);
88 trybuf.resize(str.gcount());
89 length = trybuf.size();
92 buffer =
new char[trybuf.size()];
93 std::copy(trybuf.begin(), trybuf.end(), buffer);
97 str.seekg(position_insert);