public BinaryTreeReader(Stream stream, TreeSerializationSettings settings = null) { Settings = settings ?? TreeSerializationSettings.DefaultSettings; _reader = new BinaryReader(stream, Encoding.UTF8, leaveOpen: Settings.LeaveStreamOpen); _wasBlockArrayRead = true; // Readers are required to read the first token immediately, so reading single values directly works // (All methods don't have to Read if the TokenType is still None.) Read(); }
public BinaryTreeWriter(Stream stream, TreeSerializationSettings settings = null) { Settings = settings ?? TreeSerializationSettings.DefaultSettings; _writer = new BinaryWriter(stream, Encoding.UTF8, leaveOpen: Settings.LeaveStreamOpen); }