Ejemplo n.º 1
0
    def read(reader: BitStreamReader, _index: int) -> str:
        """
        Reads Zserio string type from the bit stream.

        :param reader: Bit stream from which to read.
        :param _index: Not used.
        """

        return reader.readString()
Ejemplo n.º 2
0
 def testReadString(self):
     reader = BitStreamReader(bytes(b'\x01\x41'))
     self.assertEqual("A", reader.readString())
     self.assertEqual(16, reader.getBitPosition())
     with self.assertRaises(PythonRuntimeException):
         reader.readString()