def get_bytes(encoded: bytearray, idx: int, length: int) -> tuple:
    """
    Returns the bytes with given length, and next to be read index
    :param encoded: bytearray
    :param idx: index to start read from
    :param length: length to be read
    :return: tuple of bytes read and next index
    """
    return encoded[idx:idx + length], idx + length