GetSize() public static method

Gets the size of an entry.
public static GetSize ( ) : long
return long
Ejemplo n.º 1
0
 public HashTable([JetBrains.Annotations.NotNull] byte[] data)
 {
     using var ms = new MemoryStream(data);
     using var br = new BinaryReader(ms);
     for (long i = 0; i < data.Length; i += HashTableEntry.GetSize())
     {
         var entryBytes = br.ReadBytes((int)HashTableEntry.GetSize());
         var newEntry   = new HashTableEntry(entryBytes);
         _entries.Add(newEntry);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HashTable"/> class from
 /// a block of data containing hash table entries.
 /// </summary>
 /// <param name="data">Data.</param>
 public HashTable(byte[] data)
 {
     using (MemoryStream ms = new MemoryStream(data))
     {
         using (BinaryReader br = new BinaryReader(ms))
         {
             for (long i = 0; i < data.Length; i += HashTableEntry.GetSize())
             {
                 byte[]         entryBytes = br.ReadBytes((int)HashTableEntry.GetSize());
                 HashTableEntry newEntry   = new HashTableEntry(entryBytes);
                 this.Entries.Add(newEntry);
             }
         }
     }
 }
Ejemplo n.º 3
0
 public ulong GetSize()
 {
     return((ulong)(_entries.Count * HashTableEntry.GetSize()));
 }