public LeafContainerBase ReadTypeDirect(bool hasSize = true) { long typeStartOffset = Position; UInt16 size = 0; if (hasSize) { size = ReadUInt16(); } LeafType leafType = ReadEnum <LeafType>(); ILeaf typeSym = CreateLeafStream(leafType); typeSym.Read(); ConsumePadding(); #if !PEFF long typeDataSize = size + sizeof(UInt16); UInt32 typeHash = PerformAt(typeStartOffset, () => { byte[] typeData = ReadBytes((int)typeDataSize); return(HasherV2.HashBufferV8(typeData, 0xFFFFFFFF)); }); #endif return(new DirectLeafProvider(0, leafType, typeSym)); }
public LeafContainerBase ReadTypeDirect(bool hasSize = true) { long typeStartOffset = Position; UInt16 size = 0; if (hasSize) { size = ReadUInt16(); if (size == 0) { throw new InvalidDataException("Leaf size field cannot be 0"); } } LeafType leafType = ReadEnum <LeafType>(); ILeaf typeSym = CreateLeafStream(leafType); typeSym.Read(); Position += (typeSym as LeafBase).Length; ConsumePadding(); // for PDB 1.0: hash collides with padding, and is not properly encoded sometimes AlignStream(2); #if !PEFF long typeDataSize = size + sizeof(UInt16); UInt32 typeHash = PerformAt(typeStartOffset, () => { byte[] typeData = ReadBytes((int)typeDataSize); return(HasherV2.HashBufferV8(typeData, 0xFFFFFFFF)); }); #endif return(new DirectLeafProvider(0, leafType, typeSym)); }
public override void Read() { data.Read(); }