(self,
value, # type: bytes
flags # type: int
)
| 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 | |
| 249 | class LegacyTranscoder(Transcoder): |
nothing calls this directly
no test coverage detected