How to use the fastavro.io.symbols.Bytes function in fastavro

To help you get started, we’ve selected a few fastavro examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fastavro / fastavro / fastavro / io / parser.py View on Github external
ItemEnd(),
                self._parse(schema["items"]),
            )
            return Sequence(repeat, ArrayStart())

        elif record_type == "enum":
            return Sequence(EnumLabels(schema["symbols"]), Enum())

        elif record_type == "null":
            return Null()
        elif record_type == "boolean":
            return Boolean()
        elif record_type == "string":
            return String()
        elif record_type == "bytes":
            return Bytes()
        elif record_type == "int":
            return Int()
        elif record_type == "long":
            return Long()
        elif record_type == "float":
            return Float()
        elif record_type == "double":
            return Double()
        elif record_type == "fixed":
            return Fixed()
        else:
            raise Exception("Unhandled type: {}".format(record_type))
github fastavro / fastavro / fastavro / io / json_encoder.py View on Github external
def write_bytes(self, value):
        self._parser.advance(Bytes())
        self.write_value(btou(value, encoding='iso-8859-1'))
github fastavro / fastavro / fastavro / io / json_decoder.py View on Github external
def read_bytes(self):
        self._parser.advance(Bytes())
        return utob(self.read_value(), encoding='iso-8859-1')