public override RecordNode ReadRecordNode(BinaryReader reader, byte typeCode, bool forceDecode = false) { RecordNode recordNode = base.ReadRecordNode(reader, typeCode, forceDecode); if (forceDecode && recordNode.Name == CompressedNode.TAG_NAME) { recordNode = new CompressedNode(this, recordNode); } if (recordNode is MemoryMappedRecordNode) { (recordNode as MemoryMappedRecordNode).InvalidateSiblings = false; } return(recordNode); }
// Section can now be compressed public override RecordNode ReadRecordNode(BinaryReader reader, byte typeCode, bool forceDecode = false) { RecordNode node = base.ReadRecordNode(reader, typeCode, forceDecode) as RecordNode; if (forceDecode && node.Name == CompressedNode.TAG_NAME) { // decompress node // Console.WriteLine("reading compressed node"); node = new CompressedNode(this, node); } if (node is MemoryMappedRecordNode) { // we don't need to invalidate following sections because // all the sizes are relative so we won't need to adjust them (node as MemoryMappedRecordNode).InvalidateSiblings = false; } return(node); }