# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data.media
Class MediaBodyPart

    java.lang.Object
      javax.mail.BodyPart
          javax.mail.internet.MimeBodyPart
              com.google.gdata.data.media.MediaBodyPart

All Implemented Interfaces:
  MimePart, Part

    public class MediaBodyPart

extends MimeBodyPart

The MediaBodyPart class extends the base MimeBodyPart implementation to provide streaming media support for GData MIME multipart content. When the body part contains media content (anything other than "application/atom+xml"), the body part will use a custom `DataHandler` implementation that keeps the data in raw stream format.

See Also:
  `GDataContentHandler`, `MediaSource`, `MediaMultipart`

Field Summary

Fields inherited from class javax.mail.internet.MimeBodyPart
`content, contentStream, dh, headers`

Fields inherited from class javax.mail.BodyPart
`parent`

Fields inherited from interface javax.mail.Part
`ATTACHMENT, INLINE`

Constructor Summary
`MediaBodyPart()`
`MediaBodyPart(IEntry entry)`
`MediaBodyPart(java.io.InputStream is)`
`MediaBodyPart(InternetHeaders headers, byte[] content)`
`MediaBodyPart(MediaSource mediaSource)`

Method Summary
`MediaSource` `getMediaSource()` Returns the media source associated with the body part.
`boolean` `isAtomPart()` Returns `true` if the body part contains Atom data.

Methods inherited from class javax.mail.internet.MimeBodyPart

`addHeader, addHeaderLine, attachFile, attachFile, getAllHeaderLines, getAllHeaders, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getSize, isMimeType, removeHeader, saveFile, saveFile, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setHeader, setText, setText, setText, updateHeaders, writeTo`

Methods inherited from class javax.mail.BodyPart
`getParent`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MediaBodyPart

    public MediaBodyPart()

### MediaBodyPart

    public MediaBodyPart(java.io.InputStream is)
                  throws MessagingException

Throws:
  `MessagingException`

### MediaBodyPart

    public MediaBodyPart(IEntry entry)
                  throws MessagingException

Throws:
  `MessagingException`

### MediaBodyPart

    public MediaBodyPart(MediaSource mediaSource)
                  throws MessagingException

Throws:
  `MessagingException`

### MediaBodyPart

    public MediaBodyPart(InternetHeaders headers,
                         byte[] content)
                  throws MessagingException

Throws:
  `MessagingException`

Method Detail

### isAtomPart

    public boolean isAtomPart()
                       throws MessagingException

  Returns `true` if the body part contains Atom data.

  Throws:
    `MessagingException`

### getMediaSource

    public MediaSource getMediaSource()

  Returns the media source associated with the body part.