Package com.github.jelmerk.knn
Interface ObjectSerializer<T>
- Type Parameters:
T
- type of object to serialize.
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
JavaObjectSerializer
Implementations of this interface are used to customize how objects will be stored when the index is persisted
-
Method Summary
Modifier and TypeMethodDescriptionread
(ObjectInput in) Reads an item from an ObjectOutput implementation.void
write
(T item, ObjectOutput out) Writes the item to an ObjectOutput implementation.
-
Method Details
-
write
Writes the item to an ObjectOutput implementation.- Parameters:
item
- the item to writeout
- the ObjectOutput implementation to write to- Throws:
IOException
- in case of an I/O exception
-
read
Reads an item from an ObjectOutput implementation.- Parameters:
in
- the ObjectInput implementation to read from- Returns:
- the read item
- Throws:
IOException
- in case of an I/O exceptionClassNotFoundException
- in case the value read does not match the type of item
-