org.apache.cxf.aegis.type.mtom
Class ByteArrayType

java.lang.Object
  extended by org.apache.cxf.aegis.type.AegisType
      extended by org.apache.cxf.aegis.type.mtom.AbstractXOPType
          extended by org.apache.cxf.aegis.type.mtom.ByteArrayType

public class ByteArrayType
extends AbstractXOPType

Byte arrays. Also handles MTOM.


Field Summary
 
Fields inherited from class org.apache.cxf.aegis.type.mtom.AbstractXOPType
XML_MIME_ATTR_LOCAL_NAME, XML_MIME_BASE64, XML_MIME_CONTENT_TYPE, XML_MIME_NS, XOP_HREF, XOP_INCLUDE, XOP_NS
 
Fields inherited from class org.apache.cxf.aegis.type.AegisType
typeClass
 
Constructor Summary
ByteArrayType(boolean useXmimeBinaryType, String expectedContentTypes)
           
 
Method Summary
static void copy(InputStream input, OutputStream output)
           
protected  Attachment createAttachment(Object object, String id)
           
protected  byte[] getBytes(Object object)
          if MtoM is not enabled, we need bytes to turn into base64.
protected  String getContentType(Object object, Context context)
           
protected  Object readAttachment(Attachment att, Context context)
           
protected  Object wrapBytes(byte[] bareBytes, String contentType)
          If one of these types arrives unoptimized, we need to convert it to the desired return type.
 
Methods inherited from class org.apache.cxf.aegis.type.mtom.AbstractXOPType
addToSchemaElement, readMtoM, readObject, usesXmime, writeObject
 
Methods inherited from class org.apache.cxf.aegis.type.AegisType
equals, getDependencies, getMaxOccurs, getMinOccurs, getSchemaType, getType, getTypeClass, getTypeMapping, hashCode, hasMaxOccurs, hasMinOccurs, isAbstract, isComplex, isFlatArray, isNillable, isWriteOuter, setAbstract, setFlatArray, setNillable, setSchemaType, setTypeClass, setTypeMapping, setWriteOuter, toString, usesUtilityTypes, writeSchema
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteArrayType

public ByteArrayType(boolean useXmimeBinaryType,
                     String expectedContentTypes)
Method Detail

readAttachment

protected Object readAttachment(Attachment att,
                                Context context)
                         throws IOException
Specified by:
readAttachment in class AbstractXOPType
Throws:
IOException

copy

public static void copy(InputStream input,
                        OutputStream output)
                 throws IOException
Throws:
IOException

createAttachment

protected Attachment createAttachment(Object object,
                                      String id)
Specified by:
createAttachment in class AbstractXOPType

getContentType

protected String getContentType(Object object,
                                Context context)
Specified by:
getContentType in class AbstractXOPType

wrapBytes

protected Object wrapBytes(byte[] bareBytes,
                           String contentType)
Description copied from class: AbstractXOPType
If one of these types arrives unoptimized, we need to convert it to the desired return type.

Specified by:
wrapBytes in class AbstractXOPType
Parameters:
bareBytes - the bytes pulled out of the base64.
contentType - when we support xmime:contentType, this will be passed along.
Returns:

getBytes

protected byte[] getBytes(Object object)
Description copied from class: AbstractXOPType
if MtoM is not enabled, we need bytes to turn into base64.

Specified by:
getBytes in class AbstractXOPType
Returns:


Apache CXF