Google Data APIs Client Library (1.41.1)



com.google.gdata.data.media
Class MediaByteArraySource

java.lang.Object
  extended by com.google.gdata.data.media.BaseMediaSource
      extended by com.google.gdata.data.media.MediaByteArraySource
All Implemented Interfaces:
MediaSource, javax.activation.DataSource

public class MediaByteArraySource
extends BaseMediaSource

The MediaByteArraySource class provides a basic implementation of the MediaSource interface that reads media data from an in-memory byte array. The content length of the media source defaults to the size of the byte array and the time of modification to the current time.

See Also:
MediaSource

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.google.gdata.data.media.MediaSource
MediaSource.Output
 
Field Summary
 
Fields inherited from class com.google.gdata.data.media.BaseMediaSource
contentLength, etag, lastModified, mediaType, name
 
Constructor Summary
MediaByteArraySource(byte[] mediaBytes, java.lang.String mediaType)
          Constructs a new MediaBteyArraySource using the specified byte data and content type.
 
Method Summary
 java.io.InputStream getInputStream()
           
 java.io.OutputStream getOutputStream()
           
 
Methods inherited from class com.google.gdata.data.media.BaseMediaSource
getContentLength, getContentType, getEtag, getLastModified, getName, setContentLength, setEtag, setLastModified, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaByteArraySource

public MediaByteArraySource(byte[] mediaBytes,
                            java.lang.String mediaType)
Constructs a new MediaBteyArraySource using the specified byte data and content type.

Method Detail

getInputStream

public java.io.InputStream getInputStream()

getOutputStream

public java.io.OutputStream getOutputStream()