예제 #1
0
        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();
        }
예제 #2
0
 public BinaryTreeWriter(Stream stream, TreeSerializationSettings settings = null)
 {
     Settings = settings ?? TreeSerializationSettings.DefaultSettings;
     _writer  = new BinaryWriter(stream, Encoding.UTF8, leaveOpen: Settings.LeaveStreamOpen);
 }