FileDocCategorySizeDatePackage
OctetStreamDataHandlerDeserializer.javaAPI DocApache Axis 1.42279Sat Apr 22 18:57:28 BST 2006org.apache.axis.encoding.ser

OctetStreamDataHandlerDeserializer

public class OctetStreamDataHandlerDeserializer extends JAFDataHandlerDeserializer
application/octet-stream DataHandler Deserializer Modified by Davanum Srinivas

Fields Summary
protected static Log
log
Constructors Summary
Methods Summary
public voidstartElement(java.lang.String namespace, java.lang.String localName, java.lang.String prefix, org.xml.sax.Attributes attributes, org.apache.axis.encoding.DeserializationContext context)


         
                                
                              
              

        super.startElement(namespace, localName, prefix, attributes, context);

        if (getValue() instanceof DataHandler) {
            try {
                DataHandler dh = (DataHandler) getValue();
                InputStream in = dh.getInputStream();
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                int byte1 = -1;
                while((byte1 = in.read())!=-1)
                    baos.write(byte1);
                OctetStream os = new OctetStream(baos.toByteArray());
                setValue(os);
            } catch (IOException ioe) {
            }
        }