File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -589,6 +589,29 @@ public Asn1Reader GetReader() {
589589 return new Asn1Reader ( GetTagRawDataAsMemory ( ) , 0 , true ) ;
590590 }
591591 /// <summary>
592+ /// Returns a cloned instance of current object and current state.
593+ /// </summary>
594+ /// <returns>A cloned instance of <see cref="Asn1Reader"/>.</returns>
595+ public Asn1Reader Clone ( ) {
596+ var reader = new Asn1Reader ( GetRawDataAsMemory ( ) , 0 , true ) {
597+ currentPosition = new AsnInternalMap ( currentPosition . LevelStart , currentPosition . LevelEnd ) ,
598+ childCount = childCount ,
599+ Tag = Tag ,
600+ TagName = TagName ,
601+ TagLength = TagLength ,
602+ PayloadStartOffset = PayloadStartOffset ,
603+ PayloadLength = PayloadLength ,
604+ NextSiblingOffset = NextSiblingOffset ,
605+ NextOffset = NextOffset ,
606+ IsConstructed = IsConstructed
607+ } ;
608+ foreach ( KeyValuePair < Int64 , AsnInternalMap > mapEntry in _offsetMap ) {
609+ reader . _offsetMap . Add ( mapEntry . Key , mapEntry . Value ) ;
610+ }
611+
612+ return reader ;
613+ }
614+ /// <summary>
592615 /// Recursively processes ASN tree and builds internal offset map.
593616 /// </summary>
594617 /// <returns>A number of processed ASN structures.</returns>
You can’t perform that action at this time.
0 commit comments