File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\api\JavaObjectSerializer.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.api;
8
9 /**
10 * Custom serialization mechanism for java objects being stored in column of
11 * type OTHER.
12 *
13 * @author Sergi Vladykin
14 */
15 public interface JavaObjectSerializer {
16
17 /**
18 * Serialize object to byte array.
19 *
20 * @param obj the object to serialize
21 * @return the byte array of the serialized object
22 */
23 byte[] serialize(Object obj) throws Exception;
24
25 /**
26 * Deserialize object from byte array.
27 *
28 * @param bytes the byte array of the serialized object
29 * @return the object
30 */
31 Object deserialize(byte[] bytes) throws Exception;
32
33 }
34