Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## portlets.compoze.groupware.util
Class ByteArrayDataSource

    java.lang.Object
      portlets.compoze.groupware.util.ByteArrayDataSource

All Implemented Interfaces:
  javax.activation.DataSource

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

This class implements a typed data source from a byte array.

Constructor Summary
`ByteArrayDataSource(byte[] data, java.lang.String sContentType)` Constructor.
`ByteArrayDataSource(java.io.InputStream is, java.lang.String sContentType)` Constructor.
`ByteArrayDataSource(java.lang.String sData, java.lang.String sContentType)` Constructor.

Method Summary
`java.lang.String` | `getContentType()` Get the content type of the data.
`java.io.InputStream` | `getInputStream()` Get an input stream to the data.
`java.lang.String` | `getName()` Get a name for the data source.
`java.io.OutputStream` | `getOutputStream()` Get an output stream to the data (not supported).

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

Constructor Detail

### ByteArrayDataSource

    public ByteArrayDataSource(java.io.InputStream is,
                               java.lang.String sContentType)

  Constructor.

Parameters:
  `is` - the input stream to create from
  `sContentType` - the content-type of the data

### ByteArrayDataSource

    public ByteArrayDataSource(byte[] data,
                               java.lang.String sContentType)

  Constructor.

Parameters:
  `data` - the data
  `sContentType` - the content-type of the data

### ByteArrayDataSource

    public ByteArrayDataSource(java.lang.String sData,
                               java.lang.String sContentType)

  Constructor.

Parameters:
  `sContentType` - the content-type of the data

Method Detail

### getInputStream

    public java.io.InputStream getInputStream()
                                       throws java.io.IOException

  Get an input stream to the data.

  Specified by:
    `getInputStream` in interface `javax.activation.DataSource`
  Returns:
    the input stream to the data
  Throws:
    `java.io.IOException` - if no data is available

### getOutputStream

    public java.io.OutputStream getOutputStream()
                                         throws java.io.IOException

  Get an output stream to the data (not supported).

  Specified by:
    `getOutputStream` in interface `javax.activation.DataSource`
  Returns:
    an output stream to the data
  Throws:
    `java.io.IOException` - always thrown since this is not supported

### getContentType

    public java.lang.String getContentType()

  Get the content type of the data.

  Specified by:
    `getContentType` in interface `javax.activation.DataSource`
  Returns:
    the content type

### getName

    public java.lang.String getName()

  Get a name for the data source.

  Specified by:
    `getName` in interface `javax.activation.DataSource`
  Returns:
    a name for the data source

Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.