public void Decode(byte[] bytes) { for (int i = 0; i < bytes.Length;) { var(tag, tagLength) = BerHelpers.DecodeTag(Helpers.ArraySlice(bytes, i, bytes.Length)); i += tagLength; Add(tag); } }
public void Decode(byte[] bytes) { for (int i = 0; i < bytes.Length;) { var(tag, tagLength) = BerHelpers.DecodeTag(Helpers.ArraySlice(bytes, i, bytes.Length)); i += tagLength; var(length, lengthlength) = BerHelpers.DecodeLength(Helpers.ArraySlice(bytes, i, bytes.Length)); i += lengthlength; this[tag] = (int)length; } }