Class SerializingTranscoder

    • Constructor Detail

      • SerializingTranscoder

        public SerializingTranscoder()
        Get a serializing transcoder with the default max data size.
      • SerializingTranscoder

        public SerializingTranscoder​(int max)
        Get a serializing transcoder that specifies the max data size.
    • Method Detail

      • setPackZeros

        public void setPackZeros​(boolean packZeros)
        Description copied from interface: Transcoder
        Set whether pack zeros
        Specified by:
        setPackZeros in interface Transcoder<java.lang.Object>
      • setPrimitiveAsString

        public void setPrimitiveAsString​(boolean primitiveAsString)
        Description copied from interface: Transcoder
        Set whether store primitive type as string.
        Specified by:
        setPrimitiveAsString in interface Transcoder<java.lang.Object>
      • getMaxSize

        public final int getMaxSize()
      • isPackZeros

        public boolean isPackZeros()
        Description copied from interface: Transcoder
        Returns if transcoder packs zero.
        Specified by:
        isPackZeros in interface Transcoder<java.lang.Object>
        Returns:
      • isPrimitiveAsString

        public boolean isPrimitiveAsString()
        Description copied from interface: Transcoder
        Returns if client stores primitive type as string.
        Specified by:
        isPrimitiveAsString in interface Transcoder<java.lang.Object>
        Returns:
      • decode

        public final java.lang.Object decode​(CachedData d)
        Description copied from interface: Transcoder
        Decode the cached object into the object it represents.
        Specified by:
        decode in interface Transcoder<java.lang.Object>
        Parameters:
        d - the data
        Returns:
        the return value
      • decode0

        protected final java.lang.Object decode0​(CachedData cachedData,
                                                 byte[] data,
                                                 int flags)
      • encode

        public final CachedData encode​(java.lang.Object o)
        Description copied from interface: Transcoder
        Encode the given object for storage.
        Specified by:
        encode in interface Transcoder<java.lang.Object>
        Parameters:
        o - the object
        Returns:
        the CachedData representing what should be sent