def METHOD_NAME(self, b):
    bytes_to_be_read = len(b)
    if not bytes_to_be_read:
        return 0
    elif bytes_to_be_read % 2:
        raise ValueError(
            "cannot read odd number of bytes from UTF-16-LE encoded console"
        )
    buffer = get_buffer(b, writable=True)
    code_units_to_be_read = bytes_to_be_read // 2
    code_units_read = c_ulong()
    rv = ReadConsoleW(
        HANDLE(self.handle),
        buffer,
        code_units_to_be_read,
        byref(code_units_read),
        None,
    )
    if GetLastError() == ERROR_OPERATION_ABORTED:
        # wait for KeyboardInterrupt
        time.sleep(0.1)
    if not rv:
        raise OSError(f"Windows error: {GetLastError()}")
    if buffer[0] == EOF:
        return 0
    return 2 * code_units_read.value