Class LegacyTranscoder

    • Field Detail

      • DEFAULT_COMPRESSION_THRESHOLD

        public static final int DEFAULT_COMPRESSION_THRESHOLD
        See Also:
        Constant Field Values
    • Constructor Detail

      • LegacyTranscoder

        public LegacyTranscoder()
      • LegacyTranscoder

        public LegacyTranscoder​(int compressionThreshold)
    • Method Detail

      • doDecode

        protected LegacyDocument doDecode​(String id,
                                          com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
                                          long cas,
                                          int expiry,
                                          int flags,
                                          ResponseStatus status)
                                   throws Exception
        Description copied from class: AbstractTranscoder
        Perform the decoding of the received response.
        Specified by:
        doDecode in class AbstractTranscoder<LegacyDocument,​Object>
        Parameters:
        id - the id of the document.
        content - the encoded content of the document.
        cas - the cas value of the document.
        expiry - the expiration time of the document.
        flags - the flags set on the document.
        status - the response status.
        Returns:
        the decoded document.
        Throws:
        Exception - if something goes wrong during the decode process.
      • encodeNum

        public static byte[] encodeNum​(long l,
                                       int maxBytes)
      • decodeLong

        public static long decodeLong​(byte[] b)
      • deserialize

        protected Object deserialize​(byte[] in)
      • compress

        protected byte[] compress​(byte[] in)
      • decompress

        protected byte[] decompress​(byte[] in)