public FileContainerOptions(IRandomAccess <byte> physicalFile, FileContainerFlags flags, PathParser pathParser) { if (flags == FileContainerFlags.None) { throw new ArgumentOutOfRangeException(nameof(flags)); } this.PhysicalFile = physicalFile; this.Flags = flags; this.PathParser = pathParser; }
public FileImpl(VfsRandomAccessFile file, IRandomAccess <byte> randomAccessBase, string fullPath, FileSystem fileSystem, FileParameters fileParams) : base(new ConcurrentRandomAccess <byte>(randomAccessBase), fileSystem, fileParams) { this.File = file; this.File.AddHandleRef(); try { this.FullPath = fullPath; } catch { this.File.ReleaseHandleRef(); throw; } }
protected GitFileObject(GitFileSystem fileSystem, FileParameters fileParams, IRandomAccess <byte> baseRandomAccess) : base(fileSystem, fileParams, baseRandomAccess) { }
public ZipContainerOptions(IRandomAccess <byte> physicalFile, FileContainerFlags flags = FileContainerFlags.CreateNewSequential, PathParser?pathParser = null) : base(physicalFile, flags, pathParser ?? PathParser.Mac) { }
// メタデータ読み取りとパース試行 public static async Task <ResultOrExeption <XtsAesRandomAccessMetaData> > TryReadMetaDataAsync(IRandomAccess <byte> physical, CancellationToken cancel = default) { Memory <byte> firseSectorData = new byte[XtsAesMetaDataSize]; // ヘッダの読み込みを試行する int readSize = await physical.ReadRandomAsync(0, firseSectorData, cancel); if (readSize == XtsAesMetaDataSize) { return(TryParseMetaData(firseSectorData)); } else if (readSize == 0) { throw new CoresException("The file contents is empty."); } else { throw new CoresException("readSize != XtsAesMetaDataSize"); } }
public XtsAesRandomAccess(IRandomAccess <byte> physical, string password, bool disposeObject = false, int metaDataFlushInterval = 0) : base(physical, XtsAesSectorSize, XtsAesMetaDataSize, disposeObject, metaDataFlushInterval) { this.CurrentPassword = password; }
/// <summary> /// Overload of <see cref="IsIndexAndCountInRange{T,TSeq}"/> for type inference. /// </summary> public static Validation IsIndexAndCountInRange <T>(this Validation validation, IRandomAccess <T> seq, int index, int count, string indexParamName, string countParamName) { return(validation.IsIndexAndCountInRange <T, IRandomAccess <T> >(seq, index, count, indexParamName, countParamName)); }
/// <summary> /// Overload of <see cref="IsIndexInRange{T,TSeq}"/> for type inference. /// </summary> public static Validation IsIndexInRange <T>(this Validation validation, IRandomAccess <T> seq, int index, string paramName) { return(validation.IsIndexInRange <T, IRandomAccess <T> >(seq, index, paramName)); }