com.sun.istack
Class ByteArrayDataSource

java.lang.Object
  extended by com.sun.istack.ByteArrayDataSource
All Implemented Interfaces:
javax.activation.DataSource

public final class ByteArrayDataSource
extends java.lang.Object
implements javax.activation.DataSource

DataSource backed by a byte buffer.

Author:
Kohsuke Kawaguchi

Constructor Summary
ByteArrayDataSource(byte[] buf, int length, java.lang.String contentType)
           
ByteArrayDataSource(byte[] buf, java.lang.String contentType)
           
 
Method Summary
 java.lang.String getContentType()
           
 java.io.InputStream getInputStream()
           
 java.lang.String getName()
           
 java.io.OutputStream getOutputStream()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayDataSource

public ByteArrayDataSource(byte[] buf,
                           java.lang.String contentType)

ByteArrayDataSource

public ByteArrayDataSource(byte[] buf,
                           int length,
                           java.lang.String contentType)
Method Detail

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface javax.activation.DataSource

getInputStream

public java.io.InputStream getInputStream()
Specified by:
getInputStream in interface javax.activation.DataSource

getName

public java.lang.String getName()
Specified by:
getName in interface javax.activation.DataSource

getOutputStream

public java.io.OutputStream getOutputStream()
Specified by:
getOutputStream in interface javax.activation.DataSource