protected override CBlopOutputStream NewBlopOutputStream(CBlop aBlop) { var aFileInfo = this.GetObjectFileInfo(aBlop); var aStream = File.OpenWrite(aFileInfo.FullName); var aBlopOutputStream = new CFileSystemBlopOutputStream(aStream); return(aBlopOutputStream); }
internal override long GetBlopLength(CBlop aBlop) { var aFileInfo = this.GetObjectFileInfo(aBlop); var aLength = aFileInfo.Exists ? aFileInfo.Length : 0 ; return(aLength); }
internal void VisitSave(CBlop aBlop, Stream aStream) { if (aBlop.IsLocallyDeleted) { this.Delete(aBlop); } else { using (var aBlopOutputStream = this.NewBlopOutputStream(aBlop)) { aStream.CopyTo(aBlopOutputStream.Stream); aBlopOutputStream.Commit(); } } }
internal override Stream NewBlopInputStream(CBlop aBlop) { var aFileInfo = this.GetObjectFileInfo(aBlop); if (aFileInfo.IsNullRef()) { return(Stream.Null); } aFileInfo.Refresh(); var aStream = aFileInfo.Exists ? (Stream)File.OpenRead(aFileInfo.FullName) : Stream.Null ; return(aStream); }
protected override void Delete(CBlop aBlop) { this.GetObjectFileInfo(aBlop).Delete(); }
public override void Load(CBlop aBlop) { // The blop will request the input stream or the length as soon as it is used. // Not sure if we need some special actions for databases. }
public abstract void Load(CBlop aBlop);
protected override CBlopOutputStream NewBlopOutputStream(CBlop aBlop) => throw new InvalidOperationException();
internal override Stream NewBlopInputStream(CBlop aBlop) => Stream.Null;
internal override long GetBlopLength(CBlop aBlop) => 0;
protected override void Delete(CBlop aBlop) => throw new InvalidOperationException();
public override void Load(CBlop aBlop) => throw new InvalidOperationException();
protected abstract void Delete(CBlop aBlop);
protected abstract CBlopOutputStream NewBlopOutputStream(CBlop aBlop);
internal abstract Stream NewBlopInputStream(CBlop aBlop);
internal abstract long GetBlopLength(CBlop aBlop);