public static void Save([NotNull] this IBlobFile source, [NotNull] string filepath) { source.ThrowIfNull(nameof(source)); Requires.NotNullOrEmpty(filepath, nameof(filepath)); using var stream = new FileStream(filepath, FileMode.Create, FileAccess.Write); source.Save(stream); }
public static void Load([NotNull] this IBlobFile source, [NotNull] string filepath) { source.ThrowIfNull(nameof(source)); Requires.FileExists(filepath, nameof(filepath)); using var stream = new FileStream(filepath, FileMode.Open, FileAccess.Read); source.Load(stream); }
public BlobController(IBlobFile blobFile) { _blobFile = blobFile; }
public static byte[] GetOffsetBytes([NotNull] this IBlobFile source, int offset, int length = 1) { source.ThrowIfNull(nameof(source)); Requires.LessThanOrEqual(offset + length, source.Buffer.Length, nameof(offset)); return(source.Buffer[offset..(offset + length)]);
public static byte GetOffsetByte([NotNull] this IBlobFile source, int offset) { source.ThrowIfNull(nameof(source)); return(source.GetOffsetBytes(offset, 1)[0]); }