Package com.couchbase.client.java.codec
Class Sdk2CompatibleLegacyTranscoder
java.lang.Object
com.couchbase.client.java.codec.Sdk2CompatibleLegacyTranscoder
- All Implemented Interfaces:
Transcoder
This transcoder is compatible with the Java SDK 2 "LegacyTranscoder", which makes it usable
back to Java SDK 1 as a result.
You would really only want to move to this transcoder if you already had to use the LegacyTranscoder in SDK 2
because you were using couchbase since the SDK 1 days (you must really love couchbase, thanks! :-)).
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.couchbase.client.java.codec.Transcoder
Transcoder.EncodedValue
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]
compress
(byte[] in) <T> T
Decodes the wire representation into the entity based on the data format.protected byte[]
decompress
(byte[] in) protected Object
deserialize
(byte[] in) Encodes the given input into the wire representation based on the data format.static byte[]
encodeNum
(long l, int maxBytes) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.couchbase.client.java.codec.Transcoder
decode
-
Field Details
-
INSTANCE
-
DEFAULT_COMPRESSION_THRESHOLD
public static final int DEFAULT_COMPRESSION_THRESHOLD- See Also:
-
-
Constructor Details
-
Sdk2CompatibleLegacyTranscoder
public Sdk2CompatibleLegacyTranscoder() -
Sdk2CompatibleLegacyTranscoder
public Sdk2CompatibleLegacyTranscoder(int compressionThreshold)
-
-
Method Details
-
encode
Description copied from interface:Transcoder
Encodes the given input into the wire representation based on the data format.- Specified by:
encode
in interfaceTranscoder
- Parameters:
input
- the input object to encode.- Returns:
- the encoded wire representation of the payload.
-
decode
Description copied from interface:Transcoder
Decodes the wire representation into the entity based on the data format.- Specified by:
decode
in interfaceTranscoder
- Type Parameters:
T
- the generic type used for the decoding target.- Parameters:
target
- the target type to decode.input
- the wire representation to decode.flags
- the flags on the wire- Returns:
- the decoded entity.
-
compress
protected byte[] compress(byte[] in) -
decompress
protected byte[] decompress(byte[] in) -
encodeNum
public static byte[] encodeNum(long l, int maxBytes) -
deserialize
-