1 34 35 36 package com.micronova.util.codec; 37 38 import com.micronova.util.*; 39 40 public class CodecZip extends Codec 41 { 42 43 44 public static Object compress(Object object) throws Exception 45 { 46 if (object != null) 47 { 48 object = StringUtil.compressZip(object.toString()); 49 } 50 51 return object; 52 } 53 54 55 56 public static final Object encode(Object object) throws Exception 57 { 58 return compress(object); 59 } 60 61 62 63 public static final Object decompress(Object object) throws Exception 64 { 65 if (object != null) 66 { 67 object = StringUtil.decompressZip(object.toString()); 68 } 69 70 return object; 71 } 72 73 74 75 public static final Object decode(Object object) throws Exception 76 { 77 return decompress(object); 78 } 79 } 80 | Popular Tags |