FileDocCategorySizeDatePackage
OctetStreamDataSource.javaAPI DocApache Axis 1.41937Sat Apr 22 18:57:28 BST 2006org.apache.axis.attachments

OctetStreamDataSource

public class OctetStreamDataSource extends Object implements DataSource

Fields Summary
public static final String
CONTENT_TYPE
private final String
name
private byte[]
data
private ByteArrayOutputStream
os
Constructors Summary
public OctetStreamDataSource(String name, OctetStream data)


         
        this.name = name;
        this.data = data == null ? null : data.getBytes();
        os = new ByteArrayOutputStream();
    
Methods Summary
public java.lang.StringgetContentType()

        return CONTENT_TYPE;
    
public java.io.InputStreamgetInputStream()

        if (os.size() != 0) {
            data = os.toByteArray();
        }
        return new ByteArrayInputStream(data == null ? new byte[0] : data);
    
public java.lang.StringgetName()

        return name;
    
public java.io.OutputStreamgetOutputStream()

        if (os.size() != 0) {
            data = os.toByteArray();
        }
        return new ByteArrayOutputStream();