ImageMagick.IptcProfile.Initialize C# (CSharp) Method

Initialize() private method

private Initialize ( ) : void
return void
    private void Initialize()
    {
      if (_Values != null)
        return;

      _Values = new Collection<IptcValue>();

      if (Data == null || Data[0] != 0x1c)
        return;

      int i = 0;
      while (i + 4 < Data.Length)
      {
        if (Data[i++] != 28)
          continue;

        i++;

        IptcTag tag = (IptcTag)Data[i++];

        short count = ByteConverter.ToShort(Data, ref i);

        byte[] data = new byte[count];
        if ((count > 0) && (i + count <= Data.Length))
          Buffer.BlockCopy(Data, i, data, 0, count);
        _Values.Add(new IptcValue(tag, data));

        i += count;
      }
    }