code: def _tostream(parser, obj, stream, skipprepack = False):
      
      if hasattr(parser, 'tostream'):
          return parser.tostream(obj, stream, skipprepack)
      else:
          data = parser.tobytes(obj, skipprepack)
          cls = type(parser)
          if cls not in _deprecated_parsers:
              _deprecated_parsers.add(cls)
              warnings.warn("Parser %r does not have 'tostream' interfaces" % (cls,), UserWarning)
          return stream.write(data)
docs: Compatible to old parsers