MCPcopy Index your code
hub / github.com/couchbase/couchbase-python-client / decode_value

Method decode_value

couchbase/transcoder.py:230–246  ·  view source on GitHub ↗
(self,
                     value,  # type: bytes
                     flags  # type: int
                     )

Source from the content-addressed store, hash-verified

228 raise ValueFormatException("Only binary data supported by RawBinaryTranscoder")
229
230 def decode_value(self,
231 value, # type: bytes
232 flags # type: int
233 ) -> bytes:
234
235 format = get_decode_format(flags)
236
237 if format == FMT_BYTES:
238 if isinstance(value, bytearray):
239 value = bytes(value)
240 return value
241 elif format == FMT_UTF8:
242 raise ValueFormatException("String format type not supported by RawBinaryTranscoder")
243 elif format == FMT_JSON:
244 raise ValueFormatException("JSON format type not supported by RawBinaryTranscoder")
245 else:
246 raise ValueFormatException(f"Unrecognized format provided: {format}")
247
248
249class LegacyTranscoder(Transcoder):

Callers

nothing calls this directly

Calls 2

get_decode_formatFunction · 0.85

Tested by

no test coverage detected