public ResourceWriter(Stream stream) { if (stream == null) throw new ArgumentNullException(nameof(stream)); if (!stream.CanWrite) throw new ArgumentException(SR.Argument_StreamNotWritable); Contract.EndContractBlock(); _output = stream; _resourceList = new SortedDictionary<string, object>(FastResourceComparer.Default); _caseInsensitiveDups = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase); }