Class SerializablePortability
java.lang.Object
org.terracotta.offheapstore.storage.portability.SerializablePortability
- All Implemented Interfaces:
Portability<Serializable>
- Direct Known Subclasses:
PersistentSerializablePortability
A trivially compressed Java serialization based portability.
Class descriptors in the resultant bytes are encoded as integers. Mappings
between the integer representation and the ObjectStreamClass, and the
Class and the integer representation are stored in a single on-heap
map.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) classprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassLoaderprotected final ConcurrentMap<Object, Object> protected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddedMapping(Integer rep, ObjectStreamClass disconnected) decode(ByteBuffer buffer) Decodes aByteBufferto an object of typeT.protected static ObjectStreamClassdisconnect(ObjectStreamClass desc) encode(Serializable object) Encodes an object of typeTas aByteBuffer.private static booleanequals(ObjectStreamClass osc1, ObjectStreamClass osc2) booleanequals(Object value, ByteBuffer readBuffer) Returns true if the encoded object once decoded would beObject.equals(Object)to the supplied object.private static booleanequals(SerializablePortability.SerializableDataKey k1, SerializablePortability.SerializableDataKey k2) getObjectInputStream(InputStream input) protected intprivate static byte[]
-
Field Details
-
nextStreamIndex
protected int nextStreamIndex -
lookup
-
loader
-
-
Constructor Details
-
SerializablePortability
public SerializablePortability() -
SerializablePortability
-
-
Method Details
-
encode
Description copied from interface:PortabilityEncodes an object of typeTas aByteBuffer.- Specified by:
encodein interfacePortability<Serializable>- Parameters:
object- object to be encoded- Returns:
- the encoded object
-
decode
Description copied from interface:PortabilityDecodes aByteBufferto an object of typeT.- Specified by:
decodein interfacePortability<Serializable>- Parameters:
buffer- bytes to decode- Returns:
- the decoded object
-
getObjectOutputStream
- Throws:
IOException
-
getObjectInputStream
- Throws:
IOException
-
equals
Description copied from interface:PortabilityReturns true if the encoded object once decoded would beObject.equals(Object)to the supplied object.- Specified by:
equalsin interfacePortability<Serializable>- Parameters:
value- object to compare toreadBuffer- buffer containing encoded object- Returns:
trueif the two parameters are "equal"
-
getOrAddMapping
- Throws:
IOException
-
addedMapping
-
equals
private static boolean equals(SerializablePortability.SerializableDataKey k1, SerializablePortability.SerializableDataKey k2) -
equals
-
disconnect
-
getSerializedForm
- Throws:
IOException
-