h2/src/main/org/h2/util/Utils.java
/**
     * De-serialize the byte array to an object, eventually using the serializer
     * specified by the connection info.
     *
     * @param data the byte array
     * @param dataHandler provides the object serializer (may be null)
     * @return the object
     * @throws DbException if serialization fails
     */
De-serialize the byte array to an object, eventually using the serializer
specified by the connection info.

@param data the byte array
@param dataHandler provides the object serializer (may be null)
@return the object
@throws DbException if serialization fails
De - serialize the byte array to an object eventually using the serializer specified by the connection info . @param data the byte array @param dataHandler provides the object serializer ( may be null ) @return the object @throws DbException if serialization fails
public static Object deserialize(byte[] data, DataHandler dataHandler) {
        try {
            JavaObjectSerializer dbJavaObjectSerializer = null;
            if (dataHandler != null) {
                dbJavaObjectSerializer = dataHandler.getJavaObjectSerializer();
            }
            if (dbJavaObjectSerializer != null) {
                return dbJavaObjectSerializer.deserialize(data);
            }
            if (serializer != null) {
                return serializer.deserialize(data);
            }
            ByteArrayInputStream in = new ByteArrayInputStream(data);
            ObjectInputStream is;
            if (SysProperties.USE_THREAD_CONTEXT_CLASS_LOADER) {
                final ClassLoader loader = Thread.currentThread().getContextClassLoader();
                is = new ObjectInputStream(in) {
                    @Override
                    protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
                        try {
                            return Class.forName(desc.getName(), true, loader);
                        } catch (ClassNotFoundException e) {
                            return super.resolveClass(desc);
                        }
                    }
                };
            } else {
                is = new ObjectInputStream(in);
            }
            return is.readObject();
        } catch (Throwable e) {
            throw DbException.get(ErrorCode.DESERIALIZATION_FAILED_1, e, e.toString());
        }
    }
public static Object deserialize ( byte [ ] data , DataHandler dataHandler ) { try { JavaObjectSerializer dbJavaObjectSerializer = null ; if ( dataHandler != null ) { dbJavaObjectSerializer = dataHandler . getJavaObjectSerializer ( ) ; } if ( dbJavaObjectSerializer != null ) { return dbJavaObjectSerializer . deserialize ( data ) ; } if ( serializer != null ) { return serializer . deserialize ( data ) ; } ByteArrayInputStream in = new ByteArrayInputStream ( data ) ; ObjectInputStream is ; if ( SysProperties . USE_THREAD_CONTEXT_CLASS_LOADER ) { final ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; is = new ObjectInputStream ( in ) { @ Override protected Class < ? > resolveClass ( ObjectStreamClass desc ) throws IOException , ClassNotFoundException { try { return Class . forName ( desc . getName ( ) , true , loader ) ; } catch ( ClassNotFoundException e ) { return super . resolveClass ( desc ) ; } } } ; } else { is = new ObjectInputStream ( in ) ; } return is . readObject ( ) ; } catch ( Throwable e ) { throw DbException . get ( ErrorCode . DESERIALIZATION_FAILED_1 , e , e . toString ( ) ) ; } }
De-serialize the byte array to an object, eventually using the serializer
 specified by the connection info.
De - serialize the byte array to an object eventually using the serializer specified by the connection info .