protected override Array DecodeImproper(byte[] bytes) { string s = TransferSyntax.ToString(bytes); s = s.TrimEnd(null); string[] multiValue = ToImproperMultiValue(s); Type.PersonName[] personName = new Type.PersonName[multiValue.Length]; for (int i = 0; i < personName.Length; i++) { string item = multiValue[i]; personName[i] = new Type.PersonName(item); } return(personName); }
protected override Array DecodeProper(byte[] bytes) { string s = TransferSyntax.ToString(bytes); if (s.Length < 64 * 5) { s = s.TrimEnd(null); string[] multiValue = ToProperMultiValue(s); Type.PersonName[] personName = new Type.PersonName[multiValue.Length]; for (int i = 0; i < personName.Length; i++) { string item = multiValue[i]; personName[i] = new Type.PersonName(item); } return(personName); } else { throw new EncodingException( "A value of max. 64 * 5 characters is only allowed.", Tag, Name + "/s", s); } }