public GenericSource([NotNull] byte[] bytes, [NotNull] SerializationContext original) { _bytes = bytes; _original = original; }
public void Dispose() { _bytes = null; _original = null; }
public SerializationContext GetSubContext([CanBeNull] string relativeFile, ContextMode contextMode) { if (relativeFile == null) return this; SerializationContext context; if (_childContexts.TryGetValue(relativeFile, out context)) return context; IStreamSource streamSource = StreamSource.OpenSideLocation(relativeFile); if (streamSource == null) return null; context = new SerializationContext(contextMode, streamSource, SerializerMode, _backgroundStream); _childContexts[relativeFile] = context; return context; }