Class KryoShimServiceLoader
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimServiceLoader
-
public class KryoShimServiceLoader extends Object
Loads the highest-priority or user-selectedKryoShimService.
-
-
Field Summary
Fields Modifier and Type Field Description static StringKRYO_SHIM_SERVICESet this system property to the fully-qualified name of aKryoShimServicepackage-and-classname to force it into service.
-
Constructor Summary
Constructors Constructor Description KryoShimServiceLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidapplyConfiguration(org.apache.commons.configuration2.Configuration configuration)static voidclose()static <T> TreadClassAndObject(InputStream inputStream)A loose abstraction ofKryo.readClassAndObject(org.apache.tinkerpop.shaded.kryo.io.Input), where theinputparameter issource.static byte[]writeClassAndObjectToBytes(Object object)A loose abstraction ofKryo.writeClassAndObject(org.apache.tinkerpop.shaded.kryo.io.Output, java.lang.Object), where theoutputparameter is an internally-createdByteArrayOutputStream.
-
-
-
Field Detail
-
KRYO_SHIM_SERVICE
public static final String KRYO_SHIM_SERVICE
Set this system property to the fully-qualified name of aKryoShimServicepackage-and-classname to force it into service. Setting this property causes the priority-selection mechanism (KryoShimService.getPriority()) to be ignored.- See Also:
- Constant Field Values
-
-
Method Detail
-
applyConfiguration
public static void applyConfiguration(org.apache.commons.configuration2.Configuration configuration)
-
close
public static void close()
-
writeClassAndObjectToBytes
public static byte[] writeClassAndObjectToBytes(Object object)
A loose abstraction ofKryo.writeClassAndObject(org.apache.tinkerpop.shaded.kryo.io.Output, java.lang.Object), where theoutputparameter is an internally-createdByteArrayOutputStream. Returns the byte array underlying that stream.- Parameters:
object- an object for which the instance and class are serialized- Returns:
- the serialized form
-
readClassAndObject
public static <T> T readClassAndObject(InputStream inputStream)
A loose abstraction ofKryo.readClassAndObject(org.apache.tinkerpop.shaded.kryo.io.Input), where theinputparameter issource. Returns the deserialized object.- Type Parameters:
T- the type to which the deserialized object is cast as it is returned- Parameters:
inputStream- an input stream containing data for a serialized object class and instance- Returns:
- the deserialized object
-
-