from typing import BinaryIO


def read_hex(stream: BinaryIO) -> bytes:
    """
    Read HEX line from stream and decode as bytes

    Args:
        stream: stream to read from

    Returns: decoded bytes
    """
    return bytes.fromhex(stream.readline().decode())