public MetadataStreamHeader(GeneralMetadataHeader generalMetadataHeader, FileStream inputFile) { MetadataStreamHeaderNative?metadataStreamHeaderNative; startingAddress = MetadataStreamHeaderNative.StartingPosition(generalMetadataHeader); inputFile.Position = startingAddress; ReadMetadataStreamHeaderFromFile(inputFile); }
private void ReadMetadataStreamHeaderFromFile(FileStream inputFile) { native = inputFile. ReadStructure <MetadataStreamHeaderNative>().Value; byte[] nameBytes = new byte[32]; for (int i = 0; i < 32; i += 4) { nameBytes[i] = (byte)inputFile.ReadByte(); nameBytes[i + 1] = (byte)inputFile.ReadByte(); nameBytes[i + 2] = (byte)inputFile.ReadByte(); nameBytes[i + 3] = (byte)inputFile.ReadByte(); if (nameBytes[i] == 0 || nameBytes[i + 1] == 0 || nameBytes[i + 2] == 0 || nameBytes[i + 3] == 0) { break; } } rcName = System.Text.Encoding.Default.GetString(nameBytes).Replace("\0", ""); }