/// <exception cref="Mp3net.InvalidDataException"></exception>
 protected internal override void UnpackFrameData(byte[] bytes)
 {
     string filetype;
     try
     {
         filetype = BufferTools.ByteBufferToString(bytes, 1, 3);
     }
     catch (UnsupportedEncodingException)
     {
         filetype = "unknown";
     }
     mimeType = "image/" + filetype.ToLower();
     pictureType = bytes[4];
     int marker = BufferTools.IndexOfTerminatorForEncoding(bytes, 5, bytes[0]);
     if (marker >= 0)
     {
         description = new EncodedText(bytes[0], BufferTools.CopyBuffer(bytes, 5, marker -
              5));
         marker += description.GetTerminator().Length;
     }
     else
     {
         description = new EncodedText(bytes[0], string.Empty);
         marker = 1;
     }
     imageData = BufferTools.CopyBuffer(bytes, marker, bytes.Length - marker);
 }
Ejemplo n.º 2
0
 /// <exception cref="Mp3net.InvalidDataException"></exception>
 protected internal override void UnpackFrameData(byte[] bytes)
 {
     int marker = BufferTools.IndexOfTerminatorForEncoding(bytes, 1, bytes[0]);
     if (marker >= 0)
     {
         description = new EncodedText(bytes[0], BufferTools.CopyBuffer(bytes, 1, marker -
              1));
         marker += description.GetTerminator().Length;
     }
     else
     {
         description = new EncodedText(bytes[0], string.Empty);
         marker = 1;
     }
     try
     {
         url = BufferTools.ByteBufferToString(bytes, marker, bytes.Length - marker);
     }
     catch (UnsupportedEncodingException)
     {
         url = string.Empty;
     }
 }
Ejemplo n.º 3
0
 /// <exception cref="Mp3net.InvalidDataException"></exception>
 protected internal override void UnpackFrameData(byte[] bytes)
 {
     try
     {
         language = BufferTools.ByteBufferToString(bytes, 1, 3);
     }
     catch (UnsupportedEncodingException)
     {
         language = string.Empty;
     }
     int marker = BufferTools.IndexOfTerminatorForEncoding(bytes, 4, bytes[0]);
     if (marker >= 4)
     {
         description = new EncodedText(bytes[0], BufferTools.CopyBuffer(bytes, 4, marker -
              4));
         marker += description.GetTerminator().Length;
     }
     else
     {
         description = new EncodedText(bytes[0], string.Empty);
         marker = 4;
     }
     comment = new EncodedText(bytes[0], BufferTools.CopyBuffer(bytes, marker, bytes.Length
          - marker));
 }
Ejemplo n.º 4
0
 /// <exception cref="Mp3net.InvalidDataException"></exception>
 protected internal override void UnpackFrameData(byte[] bytes)
 {
     int marker = BufferTools.IndexOfTerminator(bytes, 1, 1);
     if (marker >= 0)
     {
         try
         {
             mimeType = BufferTools.ByteBufferToString(bytes, 1, marker - 1);
         }
         catch (UnsupportedEncodingException)
         {
             mimeType = "image/unknown";
         }
     }
     else
     {
         mimeType = "image/unknown";
     }
     pictureType = bytes[marker + 1];
     marker += 2;
     int marker2 = BufferTools.IndexOfTerminatorForEncoding(bytes, marker, bytes[0]);
     if (marker2 >= 0)
     {
         description = new EncodedText(bytes[0], BufferTools.CopyBuffer(bytes, marker, marker2
              - marker));
         marker2 += description.GetTerminator().Length;
     }
     else
     {
         description = new EncodedText(bytes[0], string.Empty);
         marker2 = marker;
     }
     imageData = BufferTools.CopyBuffer(bytes, marker2, bytes.Length - marker2);
 }