/// <summary> /// Gets if the two data are equivalent in content. /// </summary> public static bool Equal(Data A, Data B) { long size = A.Size; if (size != B.Size) { return false; } InStream astr = A.Read(); InStream bstr = B.Read(); while (size > 0) { if (astr.Read() != bstr.Read()) { return false; } size--; } return true; }
public PartionData(Data Source, long Start, long Size) { this._Source = Source; this._Start = Start; this._Size = Size; }
/// <summary> /// Creates data from the concatenation of parts. /// </summary> public static ConcatData Concat(Data[] Parts) { long[] offsets = new long[Parts.Length]; long size = 0; for (int t = 0; t < Parts.Length; t++) { offsets[t] = size; size += Parts[t].Size; } return new ConcatData(Parts, offsets, size); }
/// <summary> /// Creates data from the concatenation of parts. /// </summary> public static ConcatData Concat(List<Data> Parts) { Data[] parts = new Data[Parts.Count]; long[] offsets = new long[parts.Length]; long size = 0; for (int t = 0; t < parts.Length; t++) { offsets[t] = size; parts[t] = Parts[t]; size += parts[t].Size; } return new ConcatData(parts, offsets, size); }
public Stream(Data[] Parts, int LocalPart, long LocalStreamSize, InStream LocalStream) { this._Parts = Parts; this._LocalPart = LocalPart; this._LocalStreamSize = LocalStreamSize; this._LocalStream = LocalStream; }
public ConcatData(Data[] Parts, long[] Offsets, long Size) { this._Parts = Parts; this._Offsets = Offsets; this._Size = Size; }
/// <summary> /// Creates a file with the given data. /// </summary> public static File CreateDataFile(string Name, Data Data) { return new File { _Name = Name, _Data = Data }; }