def METHOD_NAME(self, pdu: ClientInfoPDU) -> bytes:
    """
    Encode a Client Info PDU to bytes.
    :param pdu: the Client Info PDU.
    """
    stream = BytesIO()
    stream.METHOD_NAME(Uint32LE.pack(pdu.codePage))
    stream.METHOD_NAME(Uint32LE.pack(pdu.flags))
    isUnicode = pdu.flags & ClientInfoFlags.INFO_UNICODE != 0
    hasNullBytes = pdu.codePage == 1252 or isUnicode
    nullByteCount = 1 if hasNullBytes else 0
    unicodeMultiplier = 2 if isUnicode else 0
    domain = pdu.domain + "\x00" * nullByteCount
    username = pdu.username + "\x00" * nullByteCount
    password = pdu.password + "\x00" * nullByteCount
    alternateShell = pdu.alternateShell + "\x00" * nullByteCount
    workingDir = pdu.workingDir + "\x00" * nullByteCount
    if isUnicode:
        domain = encodeUTF16LE(domain)
        username = encodeUTF16LE(username)
        password = encodeUTF16LE(password)
        alternateShell = encodeUTF16LE(alternateShell)
        workingDir = encodeUTF16LE(workingDir)
    else:
        domain = domain.encode()
        username = username.encode()
        password = password.encode()
        alternateShell = alternateShell.encode()
        workingDir = workingDir.encode()
    domainLength = len(domain) - nullByteCount * unicodeMultiplier
    usernameLength = len(username) - nullByteCount * unicodeMultiplier
    passwordLength = len(password) - nullByteCount * unicodeMultiplier
    alternateShellLength = len(alternateShell) - nullByteCount * unicodeMultiplier
    workingDirLength = len(workingDir) - nullByteCount * unicodeMultiplier
    stream.METHOD_NAME(Uint16LE.pack(domainLength))
    stream.METHOD_NAME(Uint16LE.pack(usernameLength))
    stream.METHOD_NAME(Uint16LE.pack(passwordLength))
    stream.METHOD_NAME(Uint16LE.pack(alternateShellLength))
    stream.METHOD_NAME(Uint16LE.pack(workingDirLength))
    stream.METHOD_NAME(domain)
    stream.METHOD_NAME(username)
    stream.METHOD_NAME(password)
    stream.METHOD_NAME(alternateShell)
    stream.METHOD_NAME(workingDir)
    if pdu.extraInfo is not None:
        extraInfoBytes = self.writeExtraInfo(pdu.extraInfo)
        stream.METHOD_NAME(extraInfoBytes)
    return stream.getvalue()