Class SerializingTranscoder

java.lang.Object
net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder
net.rubyeye.xmemcached.transcoders.SerializingTranscoder
All Implemented Interfaces:
Transcoder<Object>

public class SerializingTranscoder extends BaseSerializingTranscoder implements Transcoder<Object>
Transcoder that serializes and compresses objects.
  • Field Details

  • Constructor Details

    • 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 Details

    • setPackZeros

      public void setPackZeros(boolean packZeros)
      Description copied from interface: Transcoder
      Set whether pack zeros
      Specified by:
      setPackZeros in interface Transcoder<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<Object>
      Parameters:
      primitiveAsString -
    • getMaxSize

      public final int getMaxSize()
    • getTranscoderUtils

      public TranscoderUtils getTranscoderUtils()
    • isPackZeros

      public boolean isPackZeros()
      Description copied from interface: Transcoder
      Returns if transcoder packs zero.
      Specified by:
      isPackZeros in interface Transcoder<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<Object>
      Returns:
    • decode

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

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

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