org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim

## 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-selected `KryoShimService`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `KRYO_SHIM_SERVICE` Set this system property to the fully-qualified name of a `KryoShimService` package-and-classname to force it into service.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KryoShimServiceLoader()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `applyConfiguration(Configuration configuration)`
    `static void` | `close()`
    `static <T> T` | `readClassAndObject(InputStream inputStream)` A loose abstraction of `org.apache.tinkerpop.shaded.kryo.Kryo#readClassAndObject`, where the `input` parameter is `source`.
    `static byte[]` | `writeClassAndObjectToBytes(Object object)` A loose abstraction of `org.apache.tinkerpop.shaded.kryo.Kryo#writeClassAndObject`, where the `output` parameter is an internally-created `ByteArrayOutputStream`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### KRYO_SHIM_SERVICE

          public static final String KRYO_SHIM_SERVICE

      Set this system property to the fully-qualified name of a `KryoShimService` package-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

  - ### Constructor Detail

    - #### KryoShimServiceLoader

          public KryoShimServiceLoader()

  - ### Method Detail

    - #### applyConfiguration

          public static void applyConfiguration(Configuration configuration)

    - #### close

          public static void close()

    - #### writeClassAndObjectToBytes

          public static byte[] writeClassAndObjectToBytes(Object object)

      A loose abstraction of `org.apache.tinkerpop.shaded.kryo.Kryo#writeClassAndObject`, where the `output` parameter is an internally-created `ByteArrayOutputStream`. 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 of `org.apache.tinkerpop.shaded.kryo.Kryo#readClassAndObject`, where the `input` parameter is `source`. 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

Copyright © 2013–2019 Apache Software Foundation. All rights reserved.