Esempio n. 1
0
File: Data.cs Progetto: dzamkov/DUIP
 /// <summary>
 /// Writes a region to a stream.
 /// </summary>
 public static void Write(DataRegion Region, OutStream Stream)
 {
     Stream.WriteLong(Region.Start);
     Stream.WriteLong(Region.Size);
 }
Esempio n. 2
0
File: Data.cs Progetto: dzamkov/DUIP
 /// <summary>
 /// Gets a region of this data. The resulting data will have a size smaller than requested if the bounds of the region exceeds
 /// the size of the data.
 /// </summary>
 public Data GetRegion(DataRegion Region)
 {
     long dsize = this.Size;
     long size = Math.Max(0, Math.Min(Region.Size, dsize - Region.Start));
     return this.GetPartion(Region.Start, size);
 }