1 16 17 package org.apache.axis.encoding.ser; 18 19 import org.apache.axis.encoding.Base64; 20 21 import javax.xml.namespace.QName ; 22 23 30 public class Base64Deserializer extends SimpleDeserializer { 31 32 public Base64Deserializer(Class javaType, QName xmlType) { 33 super(javaType, xmlType); 34 } 35 36 43 public Object makeValue(String source) throws Exception { 44 byte [] value = Base64.decode(source); 45 46 if (value == null) { 47 if (javaType == Byte [].class) { 48 return new Byte [0]; 49 } else { 50 return new byte[0]; 51 } 52 } 53 54 if (javaType == Byte [].class) { 55 Byte [] data = new Byte [ value.length ]; 56 for (int i=0; i<data.length; i++) { 57 byte b = value[i]; 58 data[i] = new Byte (b); 59 } 60 return data; 61 } 62 return value; 63 } 64 } 65 | Popular Tags |