Example #1
0
 /// <summary>
 /// Reads a metadata table from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="tableIndex">The index of the table.</param>
 /// <param name="originalLayout">The layout of the table.</param>
 /// <param name="readRow">The method to use for reading each row in the table.</param>
 public SerializedMetadataTable(IBinaryStreamReader reader, TableIndex tableIndex, TableLayout originalLayout, ReadRowDelegate readRow)
     : base(tableIndex, originalLayout)
 {
     _reader         = reader ?? throw new ArgumentNullException(nameof(reader));
     _originalLayout = originalLayout;
     _rowCount       = (int)(reader.Length / originalLayout.RowSize);
     _readRow        = readRow ?? throw new ArgumentNullException(nameof(readRow));
 }
Example #2
0
 /// <summary>
 /// Creates a new metadata table using the provided layout.
 /// </summary>
 /// <param name="tableIndex">The index of the table.</param>
 /// <param name="layout">The layout of the table.</param>
 public MetadataTable(TableIndex tableIndex, TableLayout layout)
 {
     TableIndex = tableIndex;
     Layout     = layout ?? throw new ArgumentNullException(nameof(layout));
 }
Example #3
0
 /// <summary>
 /// Reads a metadata table from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="tableIndex">The index of the table.</param>
 /// <param name="originalLayout">The layout of the table.</param>
 /// <param name="readRow">The method to use for reading each row in the table.</param>
 /// <param name="referenceResolver">The instance used to resolve RVAs to segments.</param>
 public SerializedMetadataTable(IBinaryStreamReader reader, TableIndex tableIndex, TableLayout originalLayout,
                                ReadRowExtendedDelegate readRow, ISegmentReferenceResolver referenceResolver)
     : this(reader, tableIndex, originalLayout, (r, l) => readRow(r, l, referenceResolver))
 {
 }