code: def outputdata(self, data):
          
          if not isinstance(data, bytes):
              data = str(data).encode(self.encoding)
          self.output(MemoryStream(data))
docs: Send output with fixed length data