Exemple #1
0
 public BlockTable([NotNull] byte[] data)
 {
     using var ms = new MemoryStream(data);
     using var br = new BinaryReader(ms);
     for (long i = 0; i < data.Length; i += BlockTableEntry.GetSize())
     {
         var entryBytes = br.ReadBytes((int)BlockTableEntry.GetSize());
         _entries.Add(new BlockTableEntry(entryBytes));
     }
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BlockTable"/> class.
 /// </summary>
 /// <param name="data">The binary data.</param>
 public BlockTable(byte[] data)
 {
     using (MemoryStream ms = new MemoryStream(data))
     {
         using (BinaryReader br = new BinaryReader(ms))
         {
             for (long i = 0; i < data.Length; i += BlockTableEntry.GetSize())
             {
                 byte[] entryBytes = br.ReadBytes((int)BlockTableEntry.GetSize());
                 Entries.Add(new BlockTableEntry(entryBytes));
             }
         }
     }
 }
Exemple #3
0
 public ulong GetSize()
 {
     return((ulong)(Entries.Count * BlockTableEntry.GetSize()));
 }