KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > context > exe > converter > BytesToByteArrayConverter


1 package org.jbpm.context.exe.converter;
2
3 import org.jbpm.bytes.ByteArray;
4 import org.jbpm.context.exe.Converter;
5
6 public class BytesToByteArrayConverter implements Converter {
7
8   private static final long serialVersionUID = 1L;
9
10   public boolean supports(Class JavaDoc clazz) {
11     return (clazz==byte[].class);
12   }
13
14   public Object JavaDoc convert(Object JavaDoc o) {
15     return new ByteArray((byte[]) o);
16   }
17
18   public Object JavaDoc revert(Object JavaDoc o) {
19     return ((ByteArray)o).getBytes();
20   }
21
22 }
23
Popular Tags