public class BinaryTranscoder extends AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
Constructor and Description |
---|
BinaryTranscoder() |
Modifier and Type | Method and Description |
---|---|
java.lang.Class<BinaryDocument> |
documentType() |
protected BinaryDocument |
doDecode(java.lang.String id,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
long cas,
int expiry,
int flags,
com.couchbase.client.core.message.ResponseStatus status)
Perform the decoding of the received response.
|
protected com.couchbase.client.core.lang.Tuple2<com.couchbase.client.deps.io.netty.buffer.ByteBuf,java.lang.Integer> |
doEncode(BinaryDocument document)
Perform the encoding of the request document.
|
BinaryDocument |
newDocument(java.lang.String id,
int expiry,
com.couchbase.client.deps.io.netty.buffer.ByteBuf content,
long cas) |
protected boolean |
shouldAutoReleaseOnDecode()
Flag method to auto release decoded buffers.
|
protected boolean |
shouldAutoReleaseOnError()
Flag method to auto release buffers on decoding error.
|
decode, encode
protected BinaryDocument doDecode(java.lang.String id, com.couchbase.client.deps.io.netty.buffer.ByteBuf content, long cas, int expiry, int flags, com.couchbase.client.core.message.ResponseStatus status) throws java.lang.Exception
AbstractTranscoder
Perform the decoding of the received response.
doDecode
in class AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
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.java.lang.Exception
- if something goes wrong during the decode process.protected com.couchbase.client.core.lang.Tuple2<com.couchbase.client.deps.io.netty.buffer.ByteBuf,java.lang.Integer> doEncode(BinaryDocument document) throws java.lang.Exception
AbstractTranscoder
Perform the encoding of the request document.
doEncode
in class AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
document
- the document to encode.java.lang.Exception
- if something goes wrong during the encode process.public BinaryDocument newDocument(java.lang.String id, int expiry, com.couchbase.client.deps.io.netty.buffer.ByteBuf content, long cas)
public java.lang.Class<BinaryDocument> documentType()
protected boolean shouldAutoReleaseOnDecode()
AbstractTranscoder
Flag method to auto release decoded buffers. Override to change default behaviour (true).
shouldAutoReleaseOnDecode
in class AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
ByteBuf
passed to decode
method is to be released automatically on success (default behaviour)protected boolean shouldAutoReleaseOnError()
AbstractTranscoder
Flag method to auto release buffers on decoding error. Override to change default behaviour (true).
shouldAutoReleaseOnError
in class AbstractTranscoder<BinaryDocument,com.couchbase.client.deps.io.netty.buffer.ByteBuf>
ByteBuf
passed to decode
method is to be released automatically in case of error (default behaviour)