/// <summary>
/// Reads the header data.
/// </summary>
/// <param name="stream"></param>
/// <param name="treeNodeType"></param>
/// <param name="blockSize"></param>
internal static void ReadHeader(BinaryStreamBase stream, out EncodingDefinition treeNodeType, out int blockSize)
{
stream.Position = 0;
byte version = stream.ReadUInt8();
if (version == 109)
{
stream.Position = 0;
stream.ReadGuid();
treeNodeType = new EncodingDefinition(stream.ReadGuid());
blockSize = stream.ReadInt32();
}
else if (version == 1)
{
blockSize = stream.ReadInt32();
treeNodeType = new EncodingDefinition(stream);
}
else
{
throw new VersionNotFoundException();
}
}