com.beaglebuddy.id3.pojo

## Class AttachedPicture

- java.lang.Object
- - com.beaglebuddy.id3.pojo.AttachedPicture

-     public class AttachedPicture
      extends java.lang.Object

  This class holds information about an attached picture. It contains the following fields:

  Attached Picture Fields
  | Field | Description
  --- | --- | ---
  1. | `PictureType` | type of picture the image represents.
  2. | mimeType | the mime type of the image.
  3. | description | a description of the image.
  4. | image | the raw bytes of the image.

  See Also:
    `ID3v23FrameBodyAttachedPicture`, `ID3v24FrameBodyAttachedPicture`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AttachedPicture(PictureType pictureType, java.io.File imageFile)` constructor.
    `AttachedPicture(PictureType pictureType, java.lang.String imageFile)` constructor.
    `AttachedPicture(PictureType pictureType, java.lang.String mimeType, java.lang.String description, byte[] image)` constructor.
    `AttachedPicture(PictureType pictureType, java.lang.String mimeType, java.lang.String description, java.io.File imageFile)` constructor.
    `AttachedPicture(PictureType pictureType, java.lang.String mimeType, java.lang.String description, java.lang.String imageFile)` constructor.
    `AttachedPicture(PictureType pictureType, java.lang.String mimeType, java.lang.String description, java.net.URL imageURL)` constructor.
    `AttachedPicture(PictureType pictureType, java.net.URL imageURL)` constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getDescription()` gets the description of the image.
    `byte[]` | `getImage()` gets the raw bytes of the image.
    `java.lang.String` | `getMimeType()` gets the mime type of the image.
    `PictureType` | `getPictureType()` gets the type of picture the image represents.
    `void` | `setDescription(java.lang.String description)` sets the description of the image.
    `void` | `setImage(byte[] image)` sets the raw bytes of the image.
    `void` | `setMimeType(java.lang.String mimeType)` sets the mime type of the image.
    `void` | `setPictureType(PictureType pictureType)` sets the type of picture the image represents.
    `java.lang.String` | `toString()` get a string representation of an attached picture.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AttachedPicture

          public AttachedPicture(PictureType pictureType,
                         java.lang.String imageFile)
                          throws java.io.IOException

      constructor.
      Example:`

               import com.beaglebuddy.id3.enums.PictureType;

               AttachedPicture attachedPicture = new AttachedPicture(PictureType.BAND_LOGO, "/images/rush/band_logo.jpg");

      `
      Parameters:
        `pictureType` - `type` of picture the image represents.
        `imageFile` - path to the image file on your hard drive.
      Throws:
        `java.io.IOException` - if the image file can not be read.

    - #### AttachedPicture

          public AttachedPicture(PictureType pictureType,
                         java.io.File imageFile)
                          throws java.io.IOException

      constructor.
      Example:`

               import java.io.File;
               import com.beaglebuddy.id3.enums.PictureType;

               AttachedPicture attachedPicture = new AttachedPicture(PictureType.FRONT_COVER, new File("/images/ac dc/back in black/front_cover.jpg"));

      `
      Parameters:
        `pictureType` - `type` of picture the image represents.
        `imageFile` - file containing the image you want to store in the .mp3 file.
      Throws:
        `java.io.IOException` - if the image file can not be read.

    - #### AttachedPicture

          public AttachedPicture(PictureType pictureType,
                         java.lang.String mimeType,
                         java.lang.String description,
                         java.lang.String imageFile)
                          throws java.io.IOException

      constructor.
      Example:`

               import com.beaglebuddy.id3.enums.PictureType;

               AttachedPicture attachedPicture = new AttachedPicture(PictureType.BACK_COVER, "image/gif", "back cover of cd", "/images/valentino/cd_back-cover.gif");

      `
      Parameters:
        `pictureType` - `type` of picture the image represents.
        `mimeType` - mime type of the image (ex: image/jpg, image/gif, etc.)
        `description` - description of the image.
        `imageFile` - path to the image file on your hard drive.
      Throws:
        `java.io.IOException` - if the image file can not be read.

    - #### AttachedPicture

          public AttachedPicture(PictureType pictureType,
                         java.lang.String mimeType,
                         java.lang.String description,
                         java.io.File imageFile)
                          throws java.io.IOException

      constructor.
      Example:`

               import java.io.File;
               import com.beaglebuddy.id3.enums.PictureType;

               AttachedPicture attachedPicture = new AttachedPicture(PictureType.BAND, "image/png", "photo of the band", new File("/images/guns_n_roses.band_photo.png"));

      `
      Parameters:
        `pictureType` - `type` of picture the image represents.
        `mimeType` - mime type of the image (ex: image/jpg, image/gif, etc.)
        `description` - description of the image.
        `imageFile` - file containing the image you want to store in the .mp3 file.
      Throws:
        `java.io.IOException` - if the image file can not be read.

    - #### AttachedPicture

          public AttachedPicture(PictureType pictureType,
                         java.net.URL imageURL)
                          throws java.io.IOException

      constructor.
      Example:`

               import java.net.URL;
               import com.beaglebuddy.id3.enums.PictureType;

               AttachedPicture attachedPicture = new AttachedPicture(PictureType.DURING_RECORDING, new URL("http://www.beaglebuddy.com/images/vinnie%20moore.in%20the%20studio.jpg"));

      `
      Parameters:
        `pictureType` - `type` of picture the image represents.
        `imageURL` - url encoded URL of a file containing the image you want to store in the .mp3 file. See the `MP3(java.net.URL) constructor` for a description of the format required to specify a URL.
      Throws:
        `java.io.IOException` - if the image file can not be read.

    - #### AttachedPicture

          public AttachedPicture(PictureType pictureType,
                         java.lang.String mimeType,
                         java.lang.String description,
                         java.net.URL imageURL)
                          throws java.io.IOException

      constructor.
      Example:`

               import java.net.URL;
               import com.beaglebuddy.id3.enums.PictureType;

               AttachedPicture attachedPicture = new AttachedPicture(PictureType.DURING_PERFORMANCE, "image/gif", "live in japan", new URL("http://www.beaglebuddy.com/images/savatage.live%20in%20concert.jpg"));

      `
      Parameters:
        `pictureType` - `type` of picture the image represents.
        `mimeType` - mime type of the image (ex: image/jpg, image/gif, etc.)
        `description` - description of the image.
        `imageURL` - url encoded URL of a file containing the image you want to store in the .mp3 file. See the `MP3(java.net.URL) constructor` for a description of the format required to specify a URL.
      Throws:
        `java.io.IOException` - if the image file can not be read.

    - #### AttachedPicture

          public AttachedPicture(PictureType pictureType,
                         java.lang.String mimeType,
                         java.lang.String description,
                         byte[] image)

      constructor.
      Parameters:
        `pictureType` - `type` of picture the image represents.
        `mimeType` - mime type of the image (ex: image/jpg, image/gif, etc.)
        `description` - description of the image.
        `image` - raw bytes of the image file.

  - ### Method Detail

    - #### getPictureType

          public PictureType getPictureType()

      gets the type of picture the image represents.
      Returns:
        type of picture the image represents.
      See Also:
        `setPictureType(PictureType)`

    - #### setPictureType

          public void setPictureType(PictureType pictureType)

      sets the type of picture the image represents.
      Parameters:
        `pictureType` - type of picture the image represents.
      See Also:
        `getPictureType()`

    - #### getMimeType

          public java.lang.String getMimeType()

      gets the mime type of the image.
      Returns:
        the mime type of the image.
      See Also:
        `setMimeType(String)`

    - #### setMimeType

          public void setMimeType(java.lang.String mimeType)

      sets the mime type of the image.
      Parameters:
        `mimeType` - mime type of the image (ex: image/jpg, image/gif, etc.)
      See Also:
        `getMimeType()`

    - #### getDescription

          public java.lang.String getDescription()

      gets the description of the image.
      Returns:
        the description of the image.
      See Also:
        `setDescription(String)`

    - #### setDescription

          public void setDescription(java.lang.String description)

      sets the description of the image.
      Parameters:
        `description` - description of the image.
      See Also:
        `getDescription()`

    - #### getImage

          public byte[] getImage()

      gets the raw bytes of the image.
      Returns:
        an array containing the raw bytes of the image.
      See Also:
        `setImage(byte[])`

    - #### setImage

          public void setImage(byte[] image)

      sets the raw bytes of the image.
      Parameters:
        `image` - array containing the raw bytes of the image.
      See Also:
        `getImage()`

    - #### toString

          public java.lang.String toString()

      get a string representation of an attached picture.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation of an attached picture.