/// <summary> /// Load data inside storage and returns as Stream /// </summary> public LiteFileStream OpenRead(string id) { var file = FindById(id); if (file == null) { throw LiteException.FileNotFound(id); } return(file.OpenRead()); }
/// <summary> /// Copy all file content to a steam /// </summary> public LiteFileInfo Download(string id, Stream stream) { if (stream == null) { throw new ArgumentNullException(nameof(stream)); } var file = FindById(id); if (file == null) { throw LiteException.FileNotFound(id); } file.CopyTo(stream); return(file); }