Пример #1
0
 def decode_from_stream(self, in_stream: InputStream, length=0):
     user_context = decimal.getcontext()
     decimal.setcontext(self.context)
     value = decimal.Decimal(
         in_stream.read_bytes().decode("utf-8")).quantize(self.scale_format)
     decimal.setcontext(user_context)
     return value
Пример #2
0
 def decode_from_stream(self, in_stream: InputStream, length=0):
     return decimal.Decimal(in_stream.read_bytes().decode("utf-8"))
Пример #3
0
 def decode_from_stream(self, in_stream: InputStream, length=0):
     return in_stream.read_bytes()