Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public BlobController(IBlobFile blobFile)
 {
     _blobFile = blobFile;
 }
Exemplo n.º 4
0
        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)]);
Exemplo n.º 5
0
 public static byte GetOffsetByte([NotNull] this IBlobFile source, int offset)
 {
     source.ThrowIfNull(nameof(source));
     return(source.GetOffsetBytes(offset, 1)[0]);
 }