1 29 30 package com.caucho.jaxb.skeleton; 31 import javax.xml.bind.DatatypeConverter; 32 import javax.xml.stream.XMLStreamException; 33 import java.io.IOException ; 34 35 39 public class ByteArrayProperty extends CDataProperty { 40 public static final ByteArrayProperty PROPERTY = new ByteArrayProperty(); 41 42 protected String write(Object in) 43 throws IOException , XMLStreamException 44 { 45 return DatatypeConverter.printBase64Binary((byte[]) in); 46 } 47 48 protected Object read(String in) 49 throws IOException , XMLStreamException 50 { 51 return DatatypeConverter.parseBase64Binary(in); 52 } 53 54 public String getSchemaType() 55 { 56 return "xsd:base64Binary"; 57 } 58 } 59 | Popular Tags |