Class DefaultCoder

java.lang.Object
org.nustaq.serialization.simpleapi.DefaultCoder
All Implemented Interfaces:
FSTCoder
Direct Known Subclasses:
MinBinCoder

public class DefaultCoder
extends java.lang.Object
implements FSTCoder
Created by ruedi on 09.11.14. Encodes Objects to byte arrays and vice versa using slight value compression and a platform neutral data layout (no diff regarding big/little endian). Implementation is conservative (no unsafe) As this makes use of the stream oriented API, operation is not zero copy. However this is not too significant compared to cost of serialization. KEEP and reuse instances, creation is expensive. This class cannot be used concurrently. Works similar to the unsafe coders, but does not use Unsafe. Note that reading and writing coder must match each other in type and configuration.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected FSTConfiguration conf  
  • Constructor Summary

    Constructors 
    Constructor Description
    DefaultCoder()  
    DefaultCoder​(boolean shared, java.lang.Class... toPreRegister)  
    DefaultCoder​(java.lang.Class... preregister)  
  • Method Summary

    Modifier and Type Method Description
    FSTConfiguration getConf()  
    byte[] toByteArray​(java.lang.Object o)  
    int toByteArray​(java.lang.Object obj, byte[] result, int resultOffset, int avaiableSize)
    will throw an FSTBufferTooSmallException if buffer is too small.
    java.lang.Object toObject​(byte[] arr)  
    java.lang.Object toObject​(byte[] arr, int off, int len)  

    Methods inherited from class java.lang.Object

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