1 22 23 package org.continuent.sequoia.common.sql.filters; 24 25 import org.continuent.sequoia.common.stream.encoding.Base64; 26 import org.continuent.sequoia.common.xml.DatabasesXmlTags; 27 28 35 public class Base64Filter extends AbstractBlobFilter 36 { 37 38 41 public String encode(byte[] data) 42 { 43 try 44 { 45 return Base64.encode(data); 46 } 47 catch (Exception e) 48 { 49 e.printStackTrace(); 50 return ""; 51 } 52 } 53 54 57 public byte[] decode(String data) 58 { 59 try 60 { 61 return Base64.decode(data); 62 } 63 catch (Exception e) 64 { 65 e.printStackTrace(); 66 return null; 67 } 68 } 69 70 73 public String getXml() 74 { 75 return DatabasesXmlTags.VAL_base64; 76 } 77 78 } | Popular Tags |