new_chars = new char[offset];
if (offset != read (new_chars))
throw new ParserException ("reset stream failed");
for (int i = 0; i < offset; i++)
if (new_chars[i] != buffer[i])
throw new EncodingChangeException ("character mismatch (new: "
+ new_chars[i]
+ " [0x"
+ Integer.toString (new_chars[i], 16)
+ "] != old: "
+ " [0x"