All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.vertexium.JavaVertexiumSerializer Maven / Gradle / Ivy

There is a newer version: 4.10.0
Show newest version
package org.vertexium;

import org.vertexium.util.JavaSerializableUtils;

public class JavaVertexiumSerializer implements VertexiumSerializer {
    private static final byte[] EMPTY = new byte[0];

    @Override
    public byte[] objectToBytes(Object object) {
        if (object == null) {
            return EMPTY;
        }
        return JavaSerializableUtils.objectToBytes(object);
    }

    @Override
    @SuppressWarnings("unchecked")
    public  T bytesToObject(byte[] bytes) {
        if (bytes == null || bytes.length == 0) {
            return null;
        }
        return (T) JavaSerializableUtils.bytesToObject(bytes);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy