import zlib


def flate_encode(stream: bytes) -> bytes:
	"""Function that encodes a bytes stream using the zlib.compress method.

	Args:
		stream (bytes): stream to be encoded.

	Returns:
		bytes: the encoded stream.
	"""
	return zlib.compress(stream)